Skip to content

Pass nextProps into calcTheme #77

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

Merged
merged 1 commit into from
Oct 11, 2019

Conversation

GenoD
Copy link
Contributor

@GenoD GenoD commented Oct 2, 2019

There seems to have been a refactor to avoid the deprecated method componentWillReceiveProps. This decision lead to this.props being used within calcTheme and its function calls.

As a result, methods use outdated props including theme in my use case. Once the update is completed, the component never recalculates to use the latest props.

Ex. Developer updates the theme of a global component when changing views. The theme never updates because when theme !== nextProps.theme, all methods destructure from this.props. Thus resulting in theme(old) being used.

This fix aims to provide the most up to date props when calculating theme #78

Fixes: #78

Pass nextProps into calcTheme. Current implementation uses current props `theme` on update.
@justyn-clark
Copy link

👍

@markusguenther markusguenther merged commit 5eba72e into FriendsOfReactJS:develop Oct 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Latest props are not used in calculation of theme
4 participants