DemocracyLab / DemocracyLab/CivicTechExchange

Remove Unsafe React Lifecycles before upgrading to 17.x

Open
#514 4 comments 0 reactions 1 assignee Claimed by @SleeplessRegina View on GitHub
Front End javascript
Dominant language
JavaScript
Stars
105
Forks
71
PR merge metrics
No merged PRs in 30d

Description

React 17.x will remove several lifecycles, per [https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html](https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html)

We have components which use the following (use counts are as of creating this ticket)
- componentWillMount (5)
- componentWillReceiveProps (37)
- componentWillUpdate (2)

All of these will need to be refactored before we upgrade to React 17. (For reference, DemocracyLab currently uses React ^16.11.0.)

If we need to upgrade to 17 for other reasons before we have completed this, we can prefix each of these with UNSAFE_ and they will continue working. The [16.9 release post](https://reactjs.org/blog/2019/08/08/react-v16.9.0.html#renaming-unsafe-lifecycle-methods) suggests a codemod for this purpose.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.