sanniassin / react-input-mask

Input masking component for React. Made with attention to UX.
MIT License
2.22k stars 257 forks source link

Bugfix remove deprecated findDOMNode method #255

Closed Temirtator closed 2 years ago

Temirtator commented 3 years ago

Currently, we get such a warning:

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

This problem happens because findDOMNode method deprecated. So we don't need to use it.

This PR should solve this problem.

image

Temirtator commented 3 years ago

@LEMing yes, of course. There is no problem with build. I already checked.

eltaiguer commented 3 years ago

Would love to have this one merged too 🙂

salgado-baggy commented 3 years ago

would be awesome to have that merged :smiling_face_with_three_hearts:

blaze-su commented 3 years ago

I fully support this MR

luisbarrientosf commented 3 years ago

can you please consider to merge this

yepMad commented 3 years ago

Please put this on live

IncognitaDev commented 3 years ago

Please, accept this PR.

rafaelcavalcante commented 3 years ago

Please merge, @sanniassin :)

hicaro commented 2 years ago

@sanniassin, could you pretty please merge this?

Idaslon commented 2 years ago

Please merge this pull request, @sanniassin.

gilvaju commented 2 years ago

Please merge this pull request, @sanniassin.

yepMad commented 2 years ago

How many people does it take to approve to merge this?

ksenofobius commented 2 years ago

Any news?

TomBeckett commented 2 years ago

@sanniassin Any news? Can we merge?

lucalves commented 2 years ago

@sanniassin Can you merge this? We needing a lot.

greguintow commented 2 years ago

@sanniassin Can you please merge?

mateussouza-ms commented 2 years ago

This Pull Request has been open for a while. @sanniassin Will it be merged?

Temirtator commented 2 years ago

I'm closing this pr, since author of project does not respond for PR a long time.

As @pbarbiero I've forked this project to solve this problem. You can install it.

https://github.com/Temirtator/react-input-mask-format

belgamo commented 2 years ago

For those who are using version 2.0.4, here is a fork with the fix https://github.com/zenbill/react-input-mask/pull/1. The bundled files are in the repo too, so just point your package.json to our main branch and you should be ready to go.

ianchanning commented 1 year ago

There's actually a fundamental reason why this PR can't be merged. It breaks the tests for passing in children:

function Input(props) {
  return (
    <InputMask mask="99/99/9999" value={props.value} onChange={props.onChange}>
      <MaterialInput type="tel" disableUnderline />
    </InputMask>
  );
}

You need the findDOMNode to find the <input> DOM element within the <MaterialInput> (or in my case a custom <Input> functional component).