Remove warning caused due to usage of componentWillRecieveProps - #43
Conversation
…ieveProps 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`. 94
|
This PR was originally raised here. Since the old repo is no longer maintained, we're switching to the maintained fork. Thanks @markusguenther for maintaining this. Update: I had originally raised an issue also, on the original repo, the link to which is here. |
|
Thank you for the contribution will try to review this soonish :) |
|
Looks good to me by reading, but need to test it later on :) |
|
@markusguenther Cool. 👍 |
|
@markusguenther Did you have the time to test this? |
|
I am so sorry. Had unpredictable events at work and I promise to test this in the coming two days. Plan also to adjust the build automations a bit and GreenKeeper already mentioned updates for libraries. So you can count me in for a new release in the coming two days :) I promise 🤘🏼 |
Cool. I'll test it out in prod. Will raise an issue if I find something. ( And maybe a PR too if I get time. ) |
|
🎉 This PR is included in version 3.4.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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.