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

Make React component props required if they are necessary #99

Open
mok4ry opened this issue Apr 22, 2016 · 0 comments
Open

Make React component props required if they are necessary #99

mok4ry opened this issue Apr 22, 2016 · 0 comments

Comments

@mok4ry
Copy link
Member

mok4ry commented Apr 22, 2016

By the style guide (and enforced by the linter), the types of all properties of React components must be defined in that component's propTypes field. Properties can be flagged as required, which prompts React to throw warnings when a required property is not passed in.

Currently, we define the types of these properties but none are marked required, even though many are required by the components' logic. We should mark these properties as required, and leave alone the properties that are optional (we should also make sure that optional properties are indeed treated as optional within the component, e.g. by checking for their existence before using them).

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

1 participant