Skip to content

Feat/drop componentWillReceiveProps #1030

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 4 commits into from
Jun 29, 2018

Conversation

stepancar
Copy link
Member

In 7.8.0 eslint-plugin-react release added warning for componentWillRecieveProps jsx-eslint/eslint-plugin-react#1750
After update package-lock and reinstall dependencies linter crashes with error.
This pull migrate componentWillRecieveProps to new react lifecicle method getDerivedStateFromProps

Copy link
Member

@sapegin sapegin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Am I right that this will not work in React 15?

});
if (prevState.prevCode !== code) {
return {
...prevState,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need this line, it will merge new state with the previous for you.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sapegin yes, you're right. Thanks

@sapegin
Copy link
Member

sapegin commented Jun 27, 2018

And thanks again! 🦄

@codecov-io
Copy link

codecov-io commented Jun 27, 2018

Codecov Report

Merging #1030 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted Files Coverage Δ
src/rsg-components/Playground/Playground.js 93.33% <100%> (+0.47%) ⬆️
src/rsg-components/Styled/Styled.js 100% <100%> (ø) ⬆️

@stepancar
Copy link
Member Author

@sapegin added polyfill for support react < 16.4

@sapegin sapegin merged commit fc37c95 into master Jun 29, 2018
@sapegin sapegin deleted the feat/drop-componentWillReceiveProps branch June 29, 2018 07:43
@sapegin
Copy link
Member

sapegin commented Jun 29, 2018

That's awesome! Thanks!

@styleguidist-bot
Copy link
Collaborator

🎉 This PR is included in version 7.0.20 🎉

The release is available on:

Your semantic-release bot 📦🚀

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.

4 participants