shawn
shawn

Reputation: 169

React: ref is not a prop

When using React.js

Why do I get `ref` is not a prop & `key` is not a prop. error

Notes

Upvotes: 16

Views: 28943

Answers (1)

Piyush.kapoor
Piyush.kapoor

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

Related Questions