-
Notifications
You must be signed in to change notification settings - Fork 45.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Regression in null key handling in 0.12 (possibly intentional) #2386
Comments
hm. Yea, this was intentional to ensure more stable types through out the system. I don't think null should be treated as a valid "non-value" to align it with defaultProps, default arguments and default values in destructuring. The intention of "null" is to symbolize a missing object. However, this can be of any type. It's weird that For refs, we expect them to become objects so it is valid to have We have a two options:
|
Maybe we can support |
They don't in prod though, right? I thought we had a fallback for duplicate values that would be essentially the same? |
No, that code previously outputted |
oh. fine, warning for one version and then swap behavior. Want to send a PR? |
Will do. |
Fixes facebook#2386. Test Plan: jest
In 0.11, the code
assigned implicit keys to both children. In 0.12, it gives the error
and renders only "foo", because the key is cast to a string in ReactElement
react/src/core/ReactElement.js
Line 140 in be468c2
before it gets checked against null in traverseAllChildren:
react/src/utils/traverseAllChildren.js
Line 50 in be468c2
I guess it's okay if this is intentional but it broke a part of KA in the upgrade.
@sebmarkbage? (cc @jdan)
The text was updated successfully, but these errors were encountered: