Answers for "proptypes list of objects"

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
2

proptypes shape

PropTypes.shape({ name: PropTypes.string, age: PropTypes.number })
Posted by: Guest on December-28-2020

Browse Popular Code Answers by Language