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 on Form.Item in React.StrickMode gives warning "findDOMNode is deprecated in StrictMode" #46113

Closed
konstantinsp opened this issue Nov 27, 2023 · 3 comments
Labels
improvement improve some features Inactive

Comments

@konstantinsp
Copy link

Reproduction link

https://stackblitz.com/edit/react-mwq2xk?file=index.tsx

Steps to reproduce

open app and see the error in console

use <React.StrictMode> for the app
and add dropdown to form item

      <Dropdown menu={{ items }} trigger={['contextMenu']}>
              <Form.Item......>
                <Select..../>
              </Form.Item>
      </Dropdown>

What is expected?

no error

What is actually happening?

error

image

Warning: findDOMNode is deprecated in StrictMode. findDOMNode was passed an instance of DomWrapper which is inside StrictMode. Instead, add a ref directly to the element you want to reference.

Environment Info
antd 5.11.2
React 18.2
System windows
Browser chrome 119
Copy link

stackblitz bot commented Nov 27, 2023

Fix this issue in StackBlitz Codeflow Start a new pull request in StackBlitz Codeflow.

@MadCcc MadCcc added improvement improve some features and removed unconfirmed labels Nov 28, 2023
@bihongbin3027
Copy link

我也遇到相同的问题,有这个警告

@afc163
Copy link
Member

afc163 commented Apr 30, 2024

Trace #48709

@afc163 afc163 closed this as completed Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement improve some features Inactive
Projects
None yet
Development

No branches or pull requests

4 participants