Answers for "what is the prop type for an array in javascript react proptypes"

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
0

proptypes.arrayof/()

optionalArrayOf: PropTypes.arrayOf(PropTypes.number)
Posted by: Guest on January-17-2021

Code answers related to "what is the prop type for an array in javascript react proptypes"

Browse Popular Code Answers by Language