react proptypes elements array code example
Example 1: proptypes array of objects
MyComponent.propTypes = {
items: PropTypes.arrayOf(
PropTypes.shape({
code: PropTypes.string,
id: PropTypes.number,
})
),
};
Example 2: proptypes.arrayof/()
optionalArrayOf: PropTypes.arrayOf(PropTypes.number)