I have an array object being passed as props the array looks something like:
[
{
"title": "eat food"
},
{
"title": "Drinks",
"sub_items": [
{
"title": "Beer",
"isDrinking": true
}
]
},
{
"title": "eat Pizza"
},
{
"title": "Other Drinks",
"sub_items": [
{
"title": "Soda",
"isDrinking": false
},
{
"title": "Soda",
"isDrinking": false
}
]
}
]
What i want to do is add the propTypes validation, something like
title : PropTypes.string.isRequired
sub_items : PropTypes.array
sub_items : props validation inside the array such as title sting and isDrinking boolean.
note sure on how to achieve this on an array. (ps. my reactjs knowledge is very limited so excuse me if I am asking an obvious stupid question)