mozillascience / software-discovery-dashboard

MIT License
19 stars 8 forks source link

Make React component props required if they are necessary #99

Open mok4ry opened 8 years ago

mok4ry commented 8 years ago

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).