使用 React.js 时
为什么我得到`ref` is not a prop
& `key` is not a prop.
error
Notes
- 但是我在使用 webpack-dev-server 运行时没有遇到此错误。
- 我没有
ref
or key
在我的任何反应组件中定义。
看一下这个:https://github.com/facebook/react/pull/5744 https://github.com/facebook/react/pull/5744
ref
and key
是 React 中保留的 prop 名称,在内部使用。这就是您收到此警告的原因。
如果你想使用ref
, use this.refs.yourinput
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)