-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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 defaultProps used instead ThemeProvider after initial render #450
Conversation
@chadwatson Could you check out if this is working for you? |
Sure thing. Give me a few minutes. |
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.
Awesome, maybe we could add a test to cover #445 ?
Yes, that fixes the problem! It is still double rendering the child styled component though. Is that a problem? |
It's double rendering because you're passing a new object every time and ThemeProvider is checking the reference. In your example they are different so ThemeProvider thinks it is a new Theme. |
@k15a The difference is that he uses |
@k15a I think it's because the props on the |
Any time the props on the styled component change without re-mounting this should happen. |
Probably something to fix after this gets landed, but it feels a bit precarious to have this same logic duplicated 4x. 😬 |
Generated by 🚫 dangerJS |
@xcoderzach I wasn't thinking of the children prop. Added tests now. |
Basically the whole StyledNativeComponent.js is a duplicate of StyledComponent.js. But it feels wrong anyway^^ |
@k15a Can you confirm if that test fails without the changes on this PR? |
Yeah it's failing without the changes. |
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.
Shipping this asap, sorry for the delay!
…Provider on first render
Closes #445