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

Warning: findDOMNode is deprecated in StrictMode. #317

Open
Harmew opened this issue Oct 8, 2023 · 2 comments
Open

Warning: findDOMNode is deprecated in StrictMode. #317

Harmew opened this issue Oct 8, 2023 · 2 comments

Comments

@Harmew
Copy link

Harmew commented Oct 8, 2023

In my console, I received the following warning:

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

was able to resolve this warning by removing <React.StrictMode> from my index.tsx. However, I'm looking for suggestions or a fix that would allow me to keep using <React.StrictMode> without encountering this warning.

Does anyone have any suggestions or a solution to address this issue while still using React Strict Mode?

My component:
image

My input:
image

My packages:
react: ^18.2.0
react-dom: ^18.2.0
react-hook-form: ^7.47.0
react-input-mask: ^3.0.0-alpha.2
@types/react-input-mask: ^3.0.3

@johanguse
Copy link

Use this fork https://github.com/mona-health/react-input-mask/

@pedroSoaresll
Copy link

react-dom@19 does not support react-input-mask anymore because of this problem.

I tested @johanguse's suggestions and it works. Why not have it published in the official react-input-mask repository?

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

No branches or pull requests

3 participants