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

[Tree] React 18.3 已弃用 findDOMNode

Open duxphp opened this issue 1 year ago • 2 comments

tdesign-react 版本

1.17.0

重现链接

No response

重现步骤

使用 react 18.3+依赖,则直接提示 Warning: findDOMNode is deprecated and will be removed in the next major release. Instead, add a ref directly to the element you want to reference.

期望结果

弃用 findDOMNode 依赖

实际结果

findDOMNode 与react18 不兼容

框架版本

react(18.3)

浏览器版本

No response

系统版本

No response

Node版本

No response

补充说明

No response

duxphp avatar May 14 '24 02:05 duxphp

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

github-actions[bot] avatar May 14 '24 02:05 github-actions[bot]

  • 不是不兼容,React 19 才不兼容,现在只是警告
  • 现在已经处理过了,并不是 tdesign 引入的,请提供可以复现的 sandbox

https://github.com/Tencent/tdesign-react/blob/c49f7b2230dd0acc764e39d4418574f4a60b0738/src/tree/Tree.tsx#L264-L272

NWYLZW avatar May 14 '24 08:05 NWYLZW