Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

react proptypes example

// 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
};
Source by reactjs.org #
 
PREVIOUS NEXT
Tagged: #react #proptypes
ADD COMMENT
Topic
Name
6+8 =