Add Custom propType Validation to React Components

Joe Maddalone
InstructorJoe Maddalone

Share this video with your friends

Send Tweet

In addition to the types built into React.propTypes we can also define our own custom propType validator

~ 4 years ago

Title.propTypes = { text(props, propName, component){ console.log(props, propName, component); } }

-- It's getting consoled twice.. is it always the case ? Any specifics ?