-
Notifications
You must be signed in to change notification settings - Fork 47k
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
BREAKING CHANGE: Drop support for string refs #25454
Conversation
@@ -134,6 +134,7 @@ function validateExplicitKey(element, parentType) { | |||
// assigning it a key. | |||
let childOwner = ''; | |||
if ( | |||
__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.
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
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.
this whole file is / should be dev-only
ff75689
to
8f49e7c
Compare
8f49e7c
to
e0e03eb
Compare
Replaced by #28322 |
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
_owner
to a non-enumerable, dev-only property (like_self
and_source
)._owner
is still used by other dev-only warnings.How did you test this change?