proptypes list of objects code example
Example 1: proptypes array of objects
MyComponent.propTypes = {
items: PropTypes.arrayOf(
PropTypes.shape({
code: PropTypes.string,
id: PropTypes.number,
})
),
};
Example 2: proptypes shape
PropTypes.shape({ name: PropTypes.string, age: PropTypes.number })