Reputation: 169
When using React.js
Why do I get `ref` is not a prop
& `key` is not a prop.
error
Notes
ref
or key
defined in any of my react components.Upvotes: 16
Views: 28943
Reputation: 6803
Check this out: https://github.com/facebook/react/pull/5744
ref
and key
are reserved prop names in React, and are used internally. That's why you are getting this warning.
If you want to use ref
, use this.refs.yourinput
Upvotes: 23