我想要给一个输入框添加工具提示。为此,我将输入框包裹在工具提示中,它可以按预期显示。但是当我悬停在上面时,它会打印一个警告。
工具提示/输入框
<Tooltip title="Title">
<Input />
</Tooltip>
警告
Warning: findDOMNode is deprecated in StrictMode. findDOMNode was passed an instance of Input which is inside StrictMode. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-find-node
span
ClearableLabeledInput@http://localhost:3000/static/js/bundle.js:15995:90
Input@http://localhost:3000/static/js/bundle.js:16374:90
Trigger@http://localhost:3000/static/js/bundle.js:59906:92
Tooltip@http://localhost:3000/static/js/bundle.js:58900:26
./node_modules/antd/es/tooltip/index.js/Tooltip<@http://localhost:3000/static/js/bundle.js:20652:62
我可以通过移除<React.StrictMode>
来隐藏错误,但我想要修复这个错误。
这是 Ant Design 的 bug 还是我添加 Tooltip
的方法不正确?