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

Changed componentWillReceiveProps to componentDidUpdate #163

Conversation

lyubchev
Copy link
Contributor

@lyubchev lyubchev commented Feb 9, 2019

From the React docshttps://reactjs.org/docs/react-component.html:

Note:

These methods are considered legacy and you should avoid them in new code:

UNSAFE_componentWillUpdate()
UNSAFE_componentWillReceiveProps()

and

based on Dan Abramov's statement at reactjs/reactjs.org#721

That’s the exact use case for componentDidUpdate and it’s more accurate than componentWillReceiveProps because it only fires when the prop has actually changed

@codecov
Copy link

codecov bot commented Feb 9, 2019

Codecov Report

Merging #163 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff           @@
##           master    #163   +/-   ##
======================================
  Coverage    89.1%   89.1%           
======================================
  Files           4       4           
  Lines         101     101           
  Branches       25      25           
======================================
  Hits           90      90           
  Misses          9       9           
  Partials        2       2
Impacted Files Coverage Δ
src/component.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 103dafb...9f07738. Read the comment docs.

@ctrlplusb ctrlplusb merged commit 6452c29 into ctrlplusb:master Apr 27, 2019
@ctrlplusb
Copy link
Owner

Awesome thanks 👍

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.

2 participants