You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running eslint from the command line you'll see the error:
11:21 error Component definition is missing display name react/display-name
12:24 error Component definition is missing display name react/display-name
Expected Behavior
I know most people won't shadow React, memo or forwardRef, but I'd still expect the error to not be reported in this case.
eslint-plugin-react version
v7.37.5
eslint version
v9.26.0
node version
v22.15.0
The text was updated successfully, but these errors were encountered:
Fair, but how would you have even run into this? Prior to the new jsx renderer, this wouldn't have even been possible, but certainly it could be with the new renderer.
I couldn't find a codemod that added the displayName so I've been writing my own to clean up a mess at work. Oh, and running the linter against my test runs.
Is there an existing issue for this?
Description Overview
react/display-name
will report an errorComponent definition is missing display name
when theReact
global import is shadowed within a function scope.The same error does not occur for shadowed
memo
orforwardRef
though.Example
Running eslint from the command line you'll see the error:
Expected Behavior
I know most people won't shadow
React
,memo
orforwardRef
, but I'd still expect the error to not be reported in this case.eslint-plugin-react version
v7.37.5
eslint version
v9.26.0
node version
v22.15.0
The text was updated successfully, but these errors were encountered: