Skip to content
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

Remove warning caused due to usage of componentWillRecieveProps #95

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Remove warning caused due to usage of componentWillRecieveProps #95

wants to merge 1 commit into from

Conversation

rishichawda
Copy link

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

…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
@rishichawda
Copy link
Author

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

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.

1 participant