Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

sophiebits
Copy link
Collaborator

No description provided.

@Daniel15
Copy link
Member

Daniel15 commented Jan 8, 2014

👍 I like this.

@sebmarkbage
Copy link
Collaborator

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:

warn("This component is screwing up: %s", component);

and you always have the context in a consistent way.

@sophiebits
Copy link
Collaborator Author

Isn't that how invariant works already? We can just define toString.

@sebmarkbage
Copy link
Collaborator

invariant throws. this should just warn but it looks like it's coming here: #912

@zpao
Copy link
Member

zpao commented Apr 24, 2014

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.

@sophiebits
Copy link
Collaborator Author

@zpao Rebased, sorry for the delay.

@facebook-github-bot
Copy link

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(
Copy link
Member

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

@zpao zpao self-assigned this May 21, 2014
@sophiebits
Copy link
Collaborator Author

I believe 40b522c fixes this.

@sophiebits sophiebits closed this Jul 2, 2014
@zpao
Copy link
Member

zpao commented Jul 3, 2014

Oh yea, didn't even mean to have that happen :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants