Question 1 / 1
A developer builds a ColorList component and adds PropTypes:
import PropTypes from 'prop-types'
const ColorList = ({ colors, onRate }) => (
<div>
{colors.map(c => <Color key={c.id} {...c} onRate={onRate} />)}
</div>
)
ColorList.propTypes = {
colors: PropTypes.array.isRequired,
onRate: PropTypes.func.isRequired
}
ColorList.defaultProps = {
colors: []
}
A teammate renders <ColorList onRate={handleRate} /> with no colors prop. What happens?