-
Notifications
You must be signed in to change notification settings - Fork 47.2k
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
Include owner name in controlled <input> warning #849
Conversation
👍 I like this. |
How about we make warning tool just like invariant that takes multiple arguments? Then we make toString of Components output "ComponentName [OwnerName]". That way you can just pass a component to warnings:
and you always have the context in a consistent way. |
Isn't that how invariant works already? We can just define toString. |
invariant throws. this should just warn but it looks like it's coming here: #912 |
So... I don't know why this is still open. Can you rebase and we can move on with our lives? We don't need to worry about this warn thing now since we use errors in proptypes. |
@zpao Rebased, sorry for the delay. |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
@@ -949,7 +949,13 @@ var ReactCompositeComponentMixin = { | |||
for (var propName in propTypes) { | |||
if (propTypes.hasOwnProperty(propName)) { | |||
var error = | |||
propTypes[propName](props, propName, componentName, location); | |||
propTypes[propName].call( |
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 exposes internals (like _owner) to a public API. Please, no? At least expose the minimal API, e.g. by passing ownerName as an argument.
— @sebmarkbage
I believe 40b522c fixes this. |
Oh yea, didn't even mean to have that happen :) |
No description provided.