Move to React 16.3 and implement new lifecycle methods
See original GitHub issueSince React 16.3 was out, componentWillReceiveProps is obsolete and has been renamed UNSAFE_componentWillReceiveProps
. We should replace all its uses with recommended solutions.
Read more at React’s blog and documentation.
Here are some suggestions for each file. Note that they don’t all have the same difficulty !
- src/components/app/ZipFileViewer.js (claimed by @qmya)
Probably can be moved to
componentDidUpdate
- src/components/shared/Icon.js (claimed by @imabp)
Can be replaced by
componentDidUpdate
- src/components/shared/IdleSearchField.js (claimed by @qmya) Probably replaced with a strategy Fully uncontrolled component with a key
- src/components/shared/TreeView.js (claimed by @mstange) very possibly memoization
- src/components/shared/chart/Canvas.js Strategy unclear. Maybe Fully uncontrolled component with a key.
- src/components/shared/chart/Viewport.js (claimed by @imabp)
Probably a mix. The parts that call
setSizeNextFrame
can easily be moved tocomponentDidUpdate
. The part that compute an horizontalViewport could use a memoization strategy. The part that callsviewportNeedsUpdate
may usegetDerivedStateFromProps
. - src/components/tooltip/Tooltip.js (claimed by @Segun-Ogundipe)
Maybe moving it to
componentDidUpdate
works, but this needs careful testing. Possibly a strategy Fully uncontrolled component with a key is better.
Please comment on this issue to claim a component, and I will add your name to it. Please only work on one at a time, and send in 1 PR for each code path. This will make it easy for multiple people to work on this. We can give some more information where needed.
Issue Analytics
- State:
- Created 5 years ago
- Comments:37 (35 by maintainers)
Top Results From Across the Web
React v16.3.0: New lifecycles and context API
In React 16.3.0, we are adding a few new lifecycle methods to assist with that migration. We are also introducing new APIs for...
Read more >Explain new lifecycle methods in React v16.3 - GeeksforGeeks
React 16.3 has introduced two new lifecycle methods: getDerivedStateFromProps(); getSnapshotBeforeUpdate(). Creating a React Application: Step 1 ...
Read more >React 16.3 Lifecycle Methods - Medium
The new method getDerivedStateFromProps is a static function and is used instead of componentWillReceiveProps with React 16.3.
Read more >Understanding React v16.4+ New Component Lifecycle ...
ReactJs v16.3 introduced significant changes in component lifecycle. There has been a few deprecations of methods as well as addition of new ......
Read more >React 16.3: What's New? - Auth0
The current lifecycle methods componentWillMount , componentWillReceiveProps , and componentWillUpdate will be deprecated in a future ReactJS 16 ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@qmya @webobite I added both of you. Thanks for your help!
I just wrote a patch for TreeView.js and didn’t know about this issue…