firefox-devtools/profiler
Move to React 16.3 and implement new lifecycle methods
开放
#1,006 创建于 2018年5月17日
code maintenancehelp wantedready
仓库指标
- 星标
- (1,515 个星标)
- PR 合并指标
- (PR 指标待抓取)
描述
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