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

Add examples of correctly specified propTypes #813

Merged
merged 1 commit into from
Sep 9, 2016

Conversation

AndiDog
Copy link
Contributor

@AndiDog AndiDog commented Sep 9, 2016

Because examples for ES6 are not immediately clear - I tried propTypes: { ... } in ES6 and it didn't work unless it's static.


// Or in ES6:
class Hello extends React.Component {
static propTypes = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this isn't actually ES6 - it's using a stage 2 proposal for public class properties.

The current standard JS way of doing this is Hello.propTypes = { … }, after the class definition.

@AndiDog
Copy link
Contributor Author

AndiDog commented Sep 9, 2016

Now all three variants are documented.

@ljharb
Copy link
Member

ljharb commented Sep 9, 2016

LGTM

@ljharb ljharb merged commit 7abd9e8 into jsx-eslint:master Sep 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants