BREAKING CHANGE: Drop support for string refs#25454
Closed
eps1lon wants to merge 1 commit intofacebook:mainfrom
Closed
BREAKING CHANGE: Drop support for string refs#25454eps1lon wants to merge 1 commit intofacebook:mainfrom
eps1lon wants to merge 1 commit intofacebook:mainfrom
Conversation
eps1lon
commented
Oct 9, 2022
| // assigning it a key. | ||
| let childOwner = ''; | ||
| if ( | ||
| __DEV__ && |
Collaborator
Author
There was a problem hiding this comment.
Last place where element._owner is read I believe. Responsible for enhancing "should have unique key prop":
function InnerComponent({ childSet }) {
return <div>{childSet}</div>;
}
class App extends Component {
render() {
return <InnerComponent childSet={[<div />, <div />]} />;
}
}Warning: Each child in a list should have a unique "key" prop.
Check the render method of `InnerComponent`. It was passed a child from App. See https://reactjs.org/link/warning-keys for more information.
at div
at InnerComponent (https://cggv72.csb.app/src/index.js:14:3)
at App (https://cggv72.csb.app/src/index.js:23:1)-- https://codesandbox.io/s/warnings-with-owner-usage-cggv72
Collaborator
There was a problem hiding this comment.
this whole file is / should be dev-only
ff75689 to
8f49e7c
Compare
8f49e7c to
e0e03eb
Compare
Collaborator
Author
|
Replaced by #28322 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Part of https://github.com/reactjs/rfcs/blob/createlement-rfc/text/0000-create-element-changes.md#deprecate-string-refs-and-remove-production-mode-_owner-field
Removes support for string refers which allows moving
_ownerto a non-enumerable, dev-only property (like_selfand_source)._owneris still used by other dev-only warnings.How did you test this change?