Answers for "static propTypes = { count: PropTypes.number.isRequired, component: PropTypes.func.isRequired, }"

3

proptypes array of objects

MyComponent.propTypes = {
  items: PropTypes.arrayOf(
    PropTypes.shape({
      code: PropTypes.string,
      id: PropTypes.number,
    })
  ),
};
Posted by: Guest on September-03-2020
1

proptypes.objectof

Pokemon.propTypes = {
  pokemon: PropTypes.shape({
    name: PropTypes.string,
    id: PropTypes.number,
    base_stamina: PropTypes.number,
    base_defense: PropTypes.number
  })
}
Posted by: Guest on October-08-2020

Code answers related to "static propTypes = { count: PropTypes.number.isRequired, component: PropTypes.func.isRequired, }"

Browse Popular Code Answers by Language