FriendsOfReactJS / react-css-themr

Easy theming and composition for CSS Modules.
MIT License
23 stars 11 forks source link

Pass nextProps into calcTheme #77

Closed GenoD closed 5 years ago

GenoD commented 5 years ago

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

justyn-clark commented 5 years ago

👍