[英]Upgrade to React version 16.10.2 error while using Ant Design Components. Function components cannot be given refs
I recently upgraded to React version 16.10.2
.我最近升级到
React version 16.10.2
。 And facing errors while using And Design Components.并在使用 And Design Components 时遇到错误。
I want to use Title from Typography.我想使用排版中的标题。 Here is what I was doing earlier.
这是我之前所做的。
import { Typography } from 'antd'
const { Title } = Typography
<Title level={4}>Hello World</Title>
I have an error in console
as follows我在
console
中有如下错误
Function components cannot be given refs.
Function 组件不能给出参考。 Attempts to access this ref will fail.
尝试访问此 ref 将失败。 Did you mean to use React.forwardRef()?
你的意思是使用 React.forwardRef() 吗?
This issue has been fixed in antd@3.23.6: https://github.com/ant-design/ant-design/pull/19074此问题已在 antd@3.23.6 中修复: https://github.com/ant-design/ant-design/pull/19074
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.