javivelasco / react-css-themr

Easy theming and composition for CSS Modules.
MIT License
591 stars 68 forks source link

Remove warning caused due to usage of componentWillRecieveProps #95

Open rishichawda opened 5 years ago

rishichawda commented 5 years ago

Since componentWillRecieveProps will not be supported in future versions of react (v17.0), when used with static getDerivedStateFromProps method in a component it throws a warning that it contains legacy lifecycle method (v16.4 and above). Using shouldComponentUpdate to check props and re-render the component provides us with a way to do the same without componentWillRecieveProps. Also, now we don't need to pass props between themr component's methods since we can access updated props through this.

This also 'future-proofs' react-css-themr for React. 94

rishichawda commented 5 years ago

@javivelasco Please review and merge this if this is fine. All tests are passing.