-
Notifications
You must be signed in to change notification settings - Fork 46.8k
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
Warn when using one-shot iterators as children #24470
Conversation
expect(() => { | ||
ReactDOM.render(<Foo />, div); | ||
}).toErrorDev( | ||
'Using a TOOD-understandable-term as children is unsupported and will likely yield ' + |
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.
Tried googling "one-shot iterator" and could only find mention of it related to tensorflow. Is this really a proper term in JS-land? Even if, we probably want to add an example "Using a one-shot iterator (e.g. Array.prototype.values()) as children [...]". What do you think?
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.
Maybe just iterator
?
Using an iterator such as
[].values()
as children is unsupported and will likely yield unexpected results because it can only be iterated once. You may convert it [...]
Comparing: 8ee4f52...1610922 Critical size changesIncludes critical production bundles, as well as any change greater than 2%:
Significant size changesIncludes any change greater than 0.2%: (No significant changes) |
da5beb1
to
ec0709a
Compare
ec0709a
to
c74ca65
Compare
c74ca65
to
1610922
Compare
This pull request has been automatically marked as stale. If this pull request is still relevant, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize reviewing it yet. Your contribution is very much appreciated. |
Closing this pull request after a prolonged period of inactivity. If this issue is still present in the latest release, please ask for this pull request to be reopened. Thank you! |
Summary
Closes #20707 by adding a warning when using one-shot iterators.
How did you test this change?