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

Rename `key` prop in RowFunctionArgs component as it is a reserved React keyword

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Done
    • Icon: Minor Minor
    • None
    • None
    • Foundation
    • HAC Infra - Sprint 223

      RowFuncArgs type defines `key` as a prop (source code). Since this is a reserved React keyword, the below warning is thrown:

      console.error node_modules/react/cjs/react.development.js:172
          Warning: Unknown: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://fb.me/react-special-props)
      

      Because of the way the RowFuncArgs is used by a RowFunction which in turn returns a React.ReactElement (see here), the warning is not shown.

      However, the warning can be seen when running package-manifest-spec.tsx

            sgoodwin_redhat Steve goodwin
            hgovinda Harish Govindarajulu
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: