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

Warning on setting props.onEventName of React component #18

Closed
zetachang opened this issue Apr 12, 2015 · 1 comment
Closed

Warning on setting props.onEventName of React component #18

zetachang opened this issue Apr 12, 2015 · 1 comment
Assignees
Labels

Comments

@zetachang
Copy link
Owner

Warning: Don't set .props.onClick of the React component <input />. Instead, specify the correct value when initially creating the element. The element was created by TodoItem.

Reason

If you are on React.js v0.13, you might see this warning, since upon 0.13, props will be immutable.

Solution

To make the syntax on(:event_name) still work. We will shift to React.cloneElement (https://facebook.github.io/react/docs/top-level-api.html#react.cloneelement).

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

No branches or pull requests

2 participants