Answers for "react proptypes default value"

1

proptypes objectof

Component.propTypes = {

  booleanObjectProp: PropTypes.objectOf(
    PropTypes.bool
  ),
  
  multipleObjectProp: PropTypes.objectOf(
    PropTypes.oneOfType([
      PropType.func,
      PropType.number,
      PropType.string,
      PropType.instanceOf(Person)
    ])
  )
  
}
Posted by: Guest on September-09-2020
0

react default proptypes

const Camper = (props) => {
  return (
    <p>{props.name}</p>
  )
};

Camper.defaultProps = {name: 'CamperBot'}
Camper.propTypes = { name: PropTypes.string.isRequired}
Posted by: Guest on October-05-2021
4

react propthpes or

size: PropTypes.oneOfType([
  PropTypes.string,
  PropTypes.number
]),
Posted by: Guest on April-03-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language