sanniassin / react-input-mask

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

The example from docs doesn't work #271

Open Charlie91 opened 2 years ago

Charlie91 commented 2 years ago

Hi.

// Canadian postal code mask
const firstLetter = /(?!.*[DFIOQU])[A-VXY]/i;
const letter = /(?!.*[DFIOQU])[A-Z]/i;
const digit = /[0-9]/;
const mask = [firstLetter, digit, letter, " ", digit, letter, digit];
return <InputMask mask={mask} />;

This example from docs doesn't work for me. Any suggestions?

Here is sandbox https://codesandbox.io/s/elegant-sanderson-99534

BrianIto commented 2 years ago

Duplicated, please check: https://github.com/sanniassin/react-input-mask/issues/269

BrianIto commented 2 years ago

There's a fork of this library working fine, right now and they are reactivating the lib, check: https://github.com/comigotech/react-input-mask

ianchanning commented 1 year ago

@Charlie91 The reason is probably because your sandbox is using "react-input-mask": "2.0.4", and the example is for v3.0.0-alpha.2.