Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use of useColorMode().isDarkTheme is deprecated #161

Closed
erodewald opened this issue Mar 30, 2022 · 2 comments · Fixed by #168
Closed

Use of useColorMode().isDarkTheme is deprecated #161

erodewald opened this issue Mar 30, 2022 · 2 comments · Fixed by #168
Labels
dependencies Pull requests that update a dependency file help wanted PRs are encouraged and will be accepted

Comments

@erodewald
Copy link

While isDarkTheme was recently into @docusaurus/theme-common away from useThemeContext(), 12 days ago on Mar 18, it was deprecated entirely in favor of useColorMode().colorMode === "dark".

Usage found here:

const { isDarkTheme } = useColorMode();

As per:
https://github.com/facebook/docusaurus/blob/bb55586c20a3477e04cedcc6b50bddadfac10431/packages/docusaurus-theme-common/src/contexts/colorMode.tsx#L127-L133

@rohit-gohri rohit-gohri added dependencies Pull requests that update a dependency file help wanted PRs are encouraged and will be accepted labels Mar 31, 2022
@rohit-gohri
Copy link
Owner

Fixed in v1.0.3

@EmaSuriano
Copy link

@rohit-gohri FYI I faced the same issue when updating to version beta.21 of docusaurus. The solution I found temporaly is to keep the version to beta.20 and everything work as expected 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file help wanted PRs are encouraged and will be accepted
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants