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
Last version that did not exhibit the issue (if applicable): see dates/versions of earlier fix and fix-revert
React version:
Browser: Chrome
Stack trace (in case of a JS error):
The text was updated successfully, but these errors were encountered:
christiaanwesterbeek
changed the title
useTheme returns undefined as value again
useTheme returns undefined as value before using the ToggleThemeButton
Dec 7, 2023
What you were expecting:
Getting the theme value with the react-admin hook: useTheme().
What happened instead:
useTheme() hook returns undefined as value.
Steps to reproduce:
Go to this sandbox https://stackblitz.com/edit/github-m4as1b?file=src%2Fposts%2FPostList.tsx and see how in PostList that theme is undefined on first load of the application before using the ToggleThemeButton.
Related code:
Other information:
This was reported before #7805.
And fixed by @djhi on Jul 18, 2022: https://github.com/marmelab/react-admin/pull/7960/files#diff-5b4990e166ffe43cc265179d72851c8246ac299966ca41c97996202c540db43b
The fix got kind of reverted on May 3, 2023 with this commit 566fae4#diff-5b4990e166ffe43cc265179d72851c8246ac299966ca41c97996202c540db43b
Environment
The text was updated successfully, but these errors were encountered: