Move to React 16.3 and implement new lifecycle methods
#1,006 opened on May 17, 2018
Repository metrics
- Stars
- (1,515 stars)
- PR merge metrics
- (PR metrics pending)
Description
Since 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
setSizeNextFramecan easily be moved tocomponentDidUpdate. The part that compute an horizontalViewport could use a memoization strategy. The part that callsviewportNeedsUpdatemay usegetDerivedStateFromProps. - src/components/tooltip/Tooltip.js (claimed by @Segun-Ogundipe)
Maybe moving it to
componentDidUpdateworks, 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 is synchronized with this Jira Task