I'm using Proptypes and I'm getting
error 'map' is missing in props validation react/prop-types
How should I validate this map?
import React, { Fragment } from 'react'
import PropTypes from 'prop-types';
const ListComponent = props => {
if (!props) return null
return (
<Fragment>
{props.map((item,i) => <div key={i}>{item.name}</div>)}
</Fragment>
)
}
ListComponent.propTypes = {
props: PropTypes.any
};
export default ListComponent