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

Temporarly transition from React.FC/SFC to React.FCC

XMLWordPrintable

    • Icon: Story Story
    • Resolution: Unresolved
    • Icon: Undefined Undefined
    • None
    • openshift-4.20
    • None
    • None
    • None
    • None
    • None

      In React 18, the @types/react package was changed so that the implicit children prop in React.FC is removed.

      We want to reduce the number of changes that the future React 18 PR would have to make. Therefore, we should change our types to use our custom React.FCC type so that we can gradually adopt React 18.

      AC:

      • React.SFC is replaced with React.FCC
      • React.FC is replaced with React.FCC, when possible, if its current usage will cause a build error when updating types/react
      • Note: when we update @types/react to version 18, we should switch back to React.FC and remove the React.FCC type

      Note: Codemods can be used to cover part of the changes

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

                Created:
                Updated: