How to resolve "findDOMNode is deprecated in StrictMode" warning with react-input-mask?

305 Views Asked by At

I'm currently using the react-input-mask package in my React project, but I'm encountering a warning in the console:

"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"

It seems that this warning is related to the use of findDOMNode within the package. Has anyone encountered this issue, and is there a recommended solution for resolving it? Additionally, I'm curious if there's been any update or fix for this in newer versions of the react-input-mask package.

Here are the package details I'm currently using:

"react-input-mask": "3.0.0-alpha.2"

"@types/react-input-mask": "3.0.2"

If there's no direct solution, I'm also open to suggestions for alternative packages that provide similar functionality to react-input-mask. Thank you!

0

There are 0 best solutions below