Skip to content
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

Closed
adidahiya opened this issue Jun 16, 2016 · 5 comments
Closed

New Rule: component-display-name #1

adidahiya opened this issue Jun 16, 2016 · 5 comments

Comments

@adidahiya
Copy link
Contributor

adidahiya commented Jun 16, 2016

Require public static displayName property on classes that extend React.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.

@jkillian
Copy link
Contributor

I think React can infer a reasonable displayName in many cases, we should be sure this is really worth it before implementing

@adidahiya
Copy link
Contributor Author

It infers it from the variable identifier, which gets minified in production. I'd find this useful

@estaub
Copy link

estaub commented Feb 7, 2018

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.

@OzairP
Copy link

OzairP commented Dec 10, 2018

@estaub Sounds like you should have used source maps? IIRC dev tools will resolve source maps right to the component itself.

@adidahiya
Copy link
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants