-
Notifications
You must be signed in to change notification settings - Fork 47.5k
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
Permit non-DEV
Elements in React.Children
w/ DEV
#32117
base: main
Are you sure you want to change the base?
Conversation
Thanks for adding the test case! |
Hi I have fixed the linter issue of for ... of ... in the test case in #32061 Hope we can get this merged soon |
Hi @yungsters , The CI pipeline has issues regarding gated tests should fail but passed. We are now providing a valid test case that should pass. Shall we remove the gate comment? |
@@ -1039,6 +1039,32 @@ describe('ReactChildren', () => { | |||
}); | |||
}); | |||
|
|||
// @gate __DEV__ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed this line in my latest commit a7b0192 as it should work for both dev and prod
Object.entries(source).forEach(([key, value]) => { | ||
if (key !== '_owner' && key !== '_store') { | ||
productionElement[key] = value; | ||
} | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The way this test case needs to be contrived signals that this mix of environments should really not be supported. We could consider adding build types to the version checks to prevent apps from relying on these setups in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd expect you encounter this in development when you use 3rd party libraries that only have a single entrypoint with JSX compiled for production. Would require a lot of heavy lifting if we require libraries to ship both dev and prod entrypoints.
Summary
As mentioned in #29662 (comment), the
key
validation when usingReact.Children
does not currently support non-DEV
elements inDEV
. This minor fix preserves support for these use cases.How did you test this change?