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

Fix useTheme returns undefined as value #7960

Merged
merged 2 commits into from
Jul 18, 2022

Conversation

antoinefricker
Copy link
Contributor

Fix #7805

React-Admin useTheme hook use the store, and when no data is available there, returns the default value specified as hook parameter. As this default theme parameter is not available in theme data consumption, the best solution was to use MUI useTheme hook for reading purpose. This PR aims at automating this process and avoid misuses.

@antoinefricker antoinefricker added the RFR Ready For Review label Jul 9, 2022
Copy link
Contributor

@djhi djhi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

@djhi djhi added this to the 4.2.3 milestone Jul 9, 2022
Copy link
Contributor

@djhi djhi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to test that we return the theme from the settings when available

@antoinefricker antoinefricker modified the milestones: 4.2.3, 4.2.4 Jul 18, 2022
@djhi djhi merged commit 8556aa8 into master Jul 18, 2022
@djhi djhi deleted the 7805-usetheme-can-return-undefined branch July 18, 2022 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RFR Ready For Review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

useTheme returns undefined as value
2 participants