// proptypes using class component Detaljer.PropTypes = { detaljer: PropTypes.string.isRequired, feilkode: PropTypes.string, removeEvent: PropTypes.string.isRequired }; // proptypes using function component Detaljer.propTypes = { detaljer: PropTypes.string.isRequired, feilkode: PropTypes.string, removeEvent: PropTypes.string.isRequired };

react proptypes example

Pokemon.propTypes = { pokemon: PropTypes.shape({ name: PropTypes.string, id: PropTypes.number, base_stamina: PropTypes.number, base_defense: PropTypes.number }) }

proptypes.objectof

Similar Code Examples