-
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
When rendering an array, warnAndMonitorForKeyUse
produces warning message with undefined
#3222
Comments
To my knowledge displayName is a thing that is added via a JSXTransformer, If you use a JSX transformer it will take
And give it the display name based on what variable you are assigning it to. |
I am using grunt-react v0.10.0 (which uses react-tools v0.12.0) to transform from JSX - I didn't use JSX in the jsbin for simplicity. As I've just upgraded from ReactJS v0.10.0 to v0.12.2 I also upgraded from grunt-react v0.9.0 to v0.10.0 which uses react-tools v0.12.0 so I'm sure this should work, but I see your identical example using JSX doesn't produce this warning. However, regardless of any JSX transformer issues, I still believe this is an issue because the official docs state that:
so there shouldn't be any "side effects" within the react code from my using or not using JSX. |
@alexmcmillan all it is doing is taking
to
You can just add a |
Ok cool - I just thought this hinted at a tighter relationship between ReactJS and JSX than is implied by the documentation, but I guess there's no way react can put anything meaningful there if its missing. |
We still shouldn't write "undefined", so this sounds like a bug. |
Don't use undefined as parent name in key warning
Just upgraded from v0.10.0 to v0.12.2. Discovered I was rendering an array of child components without providing them with keys. React produced a warning:
Thought it odd that ReactJS would tell me to go look at "undefined", so I looked into the source... I'm not sure what's going on but
Here,
parentType
is the string"div"
so the linevar parentName = parentType.displayName;
doesn't make sense.Here's a simple example and the top of the stack I rummaged through to get this far:
The text was updated successfully, but these errors were encountered: