Details
-
Type:
Task
-
Status: Closed (View Workflow)
-
Priority:
P3
-
Resolution: Done
-
Affects Version/s: None
-
Fix Version/s: None
-
Labels:None
-
Template:customfield_11100 17576
Description
The following components throw lint errors because they use the deprecated React lifecycle hook, componentWillUpdate.
componentWillUpdate is deprecated since React 16.3.0, use UNSAFE_componentWillUpdate instead, see https://reactjs.org/docs/react-component.html#unsafe_componentwillupdate
lib/ProxyManager/ProxyManager.js lib/SearchAndSort/SearchAndSort.js ✖ 2 problems (2 errors, 0 warnings)
To not use the UNSAFE method, we need to use getDerivedStateFromProps or componentDidUpdate. The former occurs before render, but is a static method, meaning it cannot access `this` (instance props). The latter occurs after render() and cannot update the state (which would cause flickering); it is often used to apply focus() to an element.
TestRail: Results
Attachments
Issue Links
- is blocked by
-
STCOR-208 Iterative move to New React Context API
-
- Closed
-
- relates to
-
STSMACOM-660 Refactor away lifecycle hooks deprecated in React 17
-
- Open
-