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

[Dropdown Tree] Warning: findDOMNode is deprecated in StrictMode #42926

Closed
rhumbertgz opened this issue Jun 8, 2023 · 4 comments
Closed

[Dropdown Tree] Warning: findDOMNode is deprecated in StrictMode #42926

rhumbertgz opened this issue Jun 8, 2023 · 4 comments

Comments

@rhumbertgz
Copy link

Reproduction link

Edit on CodeSandbox

Steps to reproduce

  1. Open the codesandbox example
  2. Open your browser console and you will observe the warning error

What is expected?

No warning error

What is actually happening?

After open the demo and check the console see the following error:

Warning: findDOMNode is deprecated in StrictMode. findDOMNode was passed an instance of Tree4 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
div
Tree4@https://wvvrqp-5174.csb.app/node_modules/.vite/deps/antd.js?v=9162b410:69451:20
Tree2<@https://wvvrqp-5174.csb.app/node_modules/.vite/deps/antd.js?v=9162b410:70878:31
DirectoryTree@https://wvvrqp-5174.csb.app/node_modules/.vite/deps/antd.js?v=9162b410:71068:7
TriggerWrapper<@https://wvvrqp-5174.csb.app/node_modules/.vite/deps/antd.js?v=9162b410:17800:18
DomWrapper4@https://wvvrqp-5174.csb.app/node_modules/.vite/deps/antd.js?v=9162b410:1529:20
SingleObserver@https://wvvrqp-5174.csb.app/node_modules/.vite/deps/antd.js?v=9162b410:1572:18
ResizeObserver3@https://wvvrqp-5174.csb.app/node_modules/.vite/deps/antd.js?v=9162b410:1649:18
generateTrigger/Trigger<@https://wvvrqp-5174.csb.app/node_modules/.vite/deps/antd.js?v=9162b410:17820:28
Dropdown@https://wvvrqp-5174.csb.app/node_modules/.vite/deps/antd.js?v=9162b410:24727:22
Dropdown2@https://wvvrqp-5174.csb.app/node_modules/.vite/deps/antd.js?v=9162b410:28448:7
App preview-protocol.js:13:11232
Environment Info
antd 5.6.1
React 18.2.0
System MacOS 13.4 (22F66)
Browser Safari 16.5 / Chrome 114.0.5735.90 / Firefox 114.0 (64-bit)

Everything else works perfect besides the warning error. I tried multiple browsers and I'm using the latest version of antd and react and the error is still there. I have found previous submitted bugs for the same warning for older version of andt, there was no solution and the error keeps showing in the latest version of antd

Screenshot 2023-06-08 at 11 54 08
Screenshot 2023-06-08 at 11 46 07
Screenshot 2023-06-08 at 11 45 14

@H0JLuk
Copy link

H0JLuk commented Sep 18, 2023

i have same console error too

1 similar comment
@Deer404
Copy link

Deer404 commented Dec 11, 2023

i have same console error too

@afc163
Copy link
Member

afc163 commented Apr 30, 2024

Trace #48709

@afc163 afc163 closed this as completed Apr 30, 2024
@shamseer-ahammed
Copy link

+1

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

Successfully merging a pull request may close this issue.

5 participants