You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An array passed as props gets transformed into an object, meaning that attempting to call array methods on the props in the component fails. This behaviour, and why it happens/is necessary, is not documented anywhere.
There was a warning added to this effect in pull 6134 but it's gone AWOL somewhere along the line.
What is the expected behavior?
Update React to not mangle arrays of props.
-or-
Add an explanation as to why props cannot be a non-object to the React documentation.
Restore the warning added in pull 6134 to prevent people from making this mistake in the future.
Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?
Latest, all browsers/OSes, don't know.
The text was updated successfully, but these errors were encountered:
The props argument must be of type object to satisfy the requirements set by jsx. Allowing various other types there would make checking for special react properties like ref, key or children not only slower (remember createElement is in the hot path), but also more difficult.
Do you want to request a feature or report a bug?
Bug. I think. Maybe.
What is the current behavior?
https://jsfiddle.net/oyn139b4/2/
An array passed as props gets transformed into an object, meaning that attempting to call array methods on the props in the component fails. This behaviour, and why it happens/is necessary, is not documented anywhere.
There was a warning added to this effect in pull 6134 but it's gone AWOL somewhere along the line.
What is the expected behavior?
-or-
Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?
Latest, all browsers/OSes, don't know.
The text was updated successfully, but these errors were encountered: