Hey, no sorry what I meant was the user was an object, I should have denoted it with the shape type.
Although I wasn't sure if the user would automatically be required if all of its props were required, like this:
user: PropTypes.shape({
id: PropTypes.string.isRequired // required property user
name: PropTypes.string.isRequired // required property of user
})
I figured out that in the above, those props are only required if the user is passed in at all. To also ensure a user is passed, not just a valid user I needed:
Hey, no sorry what I meant was the user was an object, I should have denoted it with the shape type.
Although I wasn't sure if the user would automatically be required if all of its props were required, like this:
I figured out that in the above, those props are only required if the user is passed in at all. To also ensure a user is passed, not just a valid user I needed:
Shall leave it here in case it helps anyone else.
Thanks Sam, my eslint was throwing error and this fixed it!