0
点赞
收藏
分享

微信扫一扫

Warning: Function components cannot be given refs. Attempts to access this ref will fail.

Warning: Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()?

在使用react封装了一个公用组件时,组件中使用了connect连接redux后的组件,然后其他地方引用该组件后就提示以上警告。

解决方法:

导出组件时使用:

export default connect(

stateToProps, null, null, { forwardRef: true }

)(SelectEnumNode);


举报

相关推荐

0 条评论