-
Story
-
Resolution: Unresolved
-
Undefined
-
None
-
None
-
None
-
None
-
Product / Portfolio Work
-
False
-
-
False
-
2
-
None
-
None
-
OCP Console - Sprint 283
The hook originally was created to suppress this React warning:
Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in a useEffect cleanup function.
In React 18, this warning was removed as it was determined to be misleading: See https://github.com/reactwg/react-18/discussions/82
AC:
- All instances of useSafetyFirst are thoughtfully looked through by a human to determine whether we still need the ref pattern (probably not)
- Migrate instances of useSafetyFirst to useState when it makes sense
- Remove useSafetyFirst if possible