Closed martindederer closed 8 years ago
I suspect that the validation HOC's children property type definition is too restrictive. It causes warnings like
Failed propType: Invalid prop children of type object supplied to Validation(MyComponent), expected array
children
object
Validation(MyComponent)
array
in my code base.
Currently it is limited to "PropTypes.array". Shouldn't it be
React.PropTypes.oneOfType([React.PropTypes.array, React.PropTypes.element])
instead? According to the react docs the children property can be "array" or i guess "element". The latter is not stated explicitly though.
What do you think?
@martindederer I think you are probably correct that we can remove the following lines:
If you would like to put this in a PR please do. Otherwise I'll make the fix.
Fixed in v5.3.4
I suspect that the validation HOC's children property type definition is too restrictive. It causes warnings like
in my code base.
Currently it is limited to "PropTypes.array". Shouldn't it be
instead? According to the react docs the children property can be "array" or i guess "element". The latter is not stated explicitly though.
What do you think?