-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Usage of @callstack/react-theme-provider #423
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
Conversation
3826c66 to
c36b6a4
Compare
c36b6a4 to
25cff4f
Compare
4f3f703 to
e81c142
Compare
c56b199 to
4016f8c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a bug in the implementation. When running the example app, you will notice that the color of the Appbar suddenly changes from purple to teal. This doesn't happen in the material-next branch.
When searching for this teal color in Paper's codebase, I found that it's used here: https://github.com/callstack/react-native-paper/blob/material-next/example/DrawerItems.js#L60, where it's passed as a prop to a component wrapped in withTheme.
From a quick look, the problem seems to be that @callstack/react-theme-provider mutates the theme object by using lodash.merge which changes the primary color to teal for every component which is visible on next re-render. react-native-paper uses the deepmerge module which returns a new object after merging instead of mutation.
|
@souhe how is this going? |
|
@ferran @satya164 I've fixed this bug in theme-provider. This is PR with fix and unit test for the bug - callstack/react-theme-provider#21 |
f1cdee7 to
bfc159b
Compare
bfc159b to
61ec2be
Compare
Replace local
theme-providerwith@callstack/react-theme-provider