You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
this looks to be a simple fix, just need to change 2 things
the useCallback parameter name from theme to something else (value is usually the convention for setState like function), as currently if it's a function it's being called with itself (and not the actual theme, which is defined above)
add theme to callback array (and remove forcedTheme) so it'll always be up to date
The text was updated successfully, but these errors were encountered:
ryanagillie
changed the title
Callback Version of setTheme Calls Itself
Callback Version of setTheme Passes Itself
Mar 19, 2024
Trying to use the callback version of
setTheme
and noticed that the callback function is being passed to itselfAfter digging through the code:
this looks to be a simple fix, just need to change 2 things
useCallback
parameter name fromtheme
to something else (value
is usually the convention forsetState
like function), as currently if it's a function it's being called with itself (and not the actual theme, which is defined above)theme
to callback array (and removeforcedTheme
) so it'll always be up to dateThe text was updated successfully, but these errors were encountered: