-
-
Notifications
You must be signed in to change notification settings - Fork 51k
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
关于 React.Component
key
属性的使用
#817
Comments
@benjycui 好细心 |
在组件运行变成实例后,key就取不到了,想取到原先设置的key,就要再设置个为类似 |
key 在数组时是必须设置的,否则 react warning/error,所有 eventKey 没必要 |
key 在数组时是必须设置,是react需要的,不过我们现在是用了这个key的值,更好的做法可能是不要利用这个key,而加个类似 |
目标就是用户省事 |
嗯,想起了源码是用 用 当然,现在改 API 也会有兼容问题,所以在不改 API 的前提下,就需要用户多加注意了,要使用 如果之前已经有定论,这 issue 就先关了。 |
在15.6.1版本里,已经看到维护者有意去引导用户不去使用key进行逻辑处理 所以我觉得Menu组件里key相关的逻辑, |
刚才发现,在 React 中,
key
应该是被视为不可读的 facebook/react#5541然后,antd 有些组件使用了
key
,如Menu
。The text was updated successfully, but these errors were encountered: