when
children: PropTypes.string
It's showing error
Failed prop type: Invalid prop `children` of type `object` supplied to `DetailField`, expected `string`.
when
children: PropTypes.object
It's showing error
Failed prop type: Invalid prop `children` of type `string` supplied to `DetailField`, expected `object`.
And if I try to do this, I don't know if it's valid or not
children: PropTypes.object && PropTypes.string
It shows
Failed prop type: Invalid prop `children` of type `object` supplied to `DetailField`, expected `string`.
What should I do?
If I understand you correctly, you want to check for one of two prop types, object or string:
children: PropTypes.oneOfType([
PropTypes.object,
PropTypes.string,
])
Please check out the prop-types README for more information.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments