-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
[graphiql/react] useTheme hook does not update when user changes the theme #2956
Comments
@thomasheyenbrock @jonathanawesome |
Regarding the Basically one needs to add a listener to the In our plugin we made a custom hook using MUIs But I am not 100% sure graphiql should handle this, because graphiql itself it doesn't need this functionality (yet?), it feels unnecessary to have an event listener for that just as an utility? on the |
Is there an existing issue for this?
Current Behavior
Please have a look at this Codesandbox example
I created a
TestPlugin
that uses theuseTheme
hook to get the current theme.When the plugin loads, it gets the correct theme, but if the user changes it, the value returned by the hook does not update.
I need to close and reopen the plugin tab to get the updated value.
Please, have a look at the following video:
Screen.Recording.2022-12-07.at.09.21.52.mov
Expected Behavior
The value returned by
useTheme
hook should update when the user changes the theme in the settings.Steps To Reproduce
No response
Module pattern
Environment
Anything else?
No response
The text was updated successfully, but these errors were encountered: