tdesign-react icon indicating copy to clipboard operation
tdesign-react copied to clipboard

[Popconfirm] children 传入没有 ref 的函数组件时报错Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()?

Open fangxiezhen opened this issue 2 years ago • 4 comments

tdesign-react 版本

0.35.1

重现链接

No response

重现步骤

popConfirm 组件 children 使用没有 ref 的函数组件时报错 Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()?

期望结果

期望能够做个兼容,支持非 ref 组件使用

实际结果

No response

框架版本

[email protected]

浏览器版本

No response

系统版本

No response

Node版本

No response

补充说明

No response

fangxiezhen avatar Jul 15 '22 03:07 fangxiezhen

👋 @fangxiezhen,感谢给 TDesign 提出了 issue。 请根据 issue 模版确保背景信息的完善,我们将调查并尽快回复你。

github-actions[bot] avatar Jul 15 '22 03:07 github-actions[bot]

♥️ 有劳 @dengxiao0509 @uyarn @carolin913 尽快确认问题。 确认有效后将下一步计划和可能需要的时间回复给 @fangxiezhen 。

github-actions[bot] avatar Jul 15 '22 03:07 github-actions[bot]

popup 依赖ref获取dom元素导致的,这周重构一下换一种实现思路吧,很多function component 并没有处理 forwardRef 逻辑

honkinglin avatar Jul 15 '22 06:07 honkinglin

popup 依赖ref获取dom元素导致的,这周重构一下换一种实现思路吧,很多function component 并没有处理 forwardRef 逻辑

是的,必须依赖 ref 这种方式实在太过不优雅,期待优化

fangxiezhen avatar Jul 15 '22 06:07 fangxiezhen

这个 Issue 被标记为了过时 stale ,因为它已经持续 30 天没有任何活动了。删除 stale 标签或评论,否则将在 7 天内关闭。

github-actions[bot] avatar Aug 15 '22 05:08 github-actions[bot]

0.40.0 fixed

honkinglin avatar Aug 16 '22 06:08 honkinglin