Uploaded image for project: 'OpenShift Console'
  1. OpenShift Console
  2. CONSOLE-5039

Remove useSafetyFirst

XMLWordPrintable

    • Icon: Story Story
    • Resolution: Unresolved
    • Icon: Undefined Undefined
    • None
    • None
    • None
    • None
    • 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

              rh-ee-jaclee Jackson Lee
              rh-ee-jaclee Jackson Lee
              None
              None
              None
              None
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: