-
Notifications
You must be signed in to change notification settings - Fork 917
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
Up usehooks ts #707
Up usehooks ts #707
Conversation
Nice job @technophile-04, digging so fast into the problem, documenting it and trying this approach 🙌
Here are the results of my first tests in Chrome and Firefox (both working equal for me):
|
Yeah !, really weird happens with me too Thanks @Pabl0cks for the really nice testing and reproduction as always !!! After debugging a lot for Create #712 with At the beginning, I thought it's not worth using the whole library just to handle the theme but digging a bit deep in the NextJS context I think its worth using due to all the caveats present, and handling them ourselves properly might be a pain. |
Tysm all, Merging this 🙌! |
* Add Optimism Sepolia config (#711) * Use arbitrumSepolia instead of Goerli (#716) * up rainbowkit version to 1.3.5 (#719) * removing lock file * use next-themes to handle theme and update usehooks-ts (#707) * Feat: Better complex struct inputs (#702) * improve debug struct UI (#726) * add basic example to show connected address (#721) --------- Co-authored-by: winnsterx <46658657+winnsterx@users.noreply.github.com> Co-authored-by: Shiv Bhonde | shivbhonde.eth <shivbhonde04@gmail.com> Co-authored-by: Carlos Sánchez <oceanrdn@gmail.com>
Removed useDarkMode leftovers after c1e7ca0. Related to scaffold-eth/scaffold-eth-2#707.
Description
Updated all the
usehooks-ts
package, it seems thatuseDarkMode
is (broken still)*.I tried both our custom
useDarkMode
anduseDarkMode
fromusehooks-ts
.For some strange reason it borken on my arc browser but it works fine Chrome! :(
Screen.Recording.2024-02-08.at.12.02.12.AM.mov
I think one of the main reason might be both rely on
useMediaQueryHook
which relies on(prefers-color-scheme: dark)
as I read few discussions it might be the case even though user OS is set to light, some browser extension or browser itself can force(prefers-color-scheme)
to be dark or lightWould love it if others could test, will try to dig more on this also please feel free to suggest any other approaches to handle it 🙌
Also a question :
What if we use some alternate approaches to handle theme ? Which will handle both flickering of theme on initial render (when dark mode is choosen) and also handle this theme switch logic ?
It seems people tend to use:
next-theme