1×
Become a member
to unlock all features
Autoplay

    Define Prop Types for a React Class Component

    reactReact
    ^16.6.1

    React components rely on props for any data that isn’t encapsulated into their internal state. We can help ensure that our components receive their required props and that the props passed in are of the correct types by defining prop types for our components. In this lesson, we’ll see how the React ESLint plugin enforces the use of prop types and how to define them in a component using the prop-types package.