An input component build to be used with custom masks
https://react-awesome-mask-input.netlify.app/
npm i react-awesome-mask-input
or
yarn add react-awesome-mask-input
To use it, you will need to import the component and use it like:
import MaskInput from 'react-awesome-mask-input';
<MaskInput type="text" mask="(99) 9999-9999" />
<MaskInput type="text" mask={['(99) 9999-9999', '(99) 9 9999-9999']} placeholder="Phone number" />