-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New Rule: component-display-name #1
Comments
I think React can infer a reasonable displayName in many cases, we should be sure this is really worth it before implementing |
It infers it from the variable identifier, which gets minified in production. I'd find this useful |
I just got through debugging a React resolve()-related bug that only showed up in production mode, where code is minified and it's really hard to know where you are. As @adidahiya noted, inferred displayNames are mostly junk in this context. In production code, real displayNames are valuable signposts in a semantic desert. |
@estaub Sounds like you should have used source maps? IIRC dev tools will resolve source maps right to the component itself. |
Should be covered by typescript-eslint + https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/display-name.md |
Require
public static displayName
property on classes that extendReact.Component
.Since we don't have the type checker yet, this will only be able to verify classes that directly extend
React.Component
, not any subclasses of it.The text was updated successfully, but these errors were encountered: