Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

strictMode 下,popover 组件内部使用的 findDOMNode 会有警告 #5154

Closed
leviathan-n opened this issue May 7, 2022 · 4 comments
Closed
Labels

Comments

@leviathan-n
Copy link

Version of antd-mobile

5.11.2

Operating system and its version

Others

Browser and its version

edge 101.0.1210.39

Sandbox to reproduce

No response

What happened?

日志应该报的是这一行

const node = findDOMNode(this)

Relevant log output

Warning: findDOMNode is deprecated in StrictMode. findDOMNode was passed an instance of Wrapper 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

...

overrideMethod	@	react_devtools_backend.js:3973
printWarning	@	react-dom.development.js:67
error	@	react-dom.development.js:43
findHostInstanceWithWarning	@	react-dom.development.js:25406
findDOMNode	@	react-dom.development.js:26067
componentDidUpdate	@	wrapper.js:15
componentDidMount	@	wrapper.js:10
commitLifeCycles	@	react-dom.development.js:20663
@leviathan-n leviathan-n added the bug label May 7, 2022
@awmleer
Copy link
Member

awmleer commented May 7, 2022

的确是预期行为,但是目前我们还没有找到更好的替代方案,所以只能继续用 findDOMNode

@awmleer
Copy link
Member

awmleer commented May 7, 2022

目前先忽略就好,不会影响任何功能的,我在文档上 FAQ 里注明一下

@leviathan-n
Copy link
Author

了解 issue 我关了吧

@flycj
Copy link

flycj commented Aug 9, 2024

请问还没解决这个告警吗?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants