sanniassin / react-input-mask

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

react-input-mask with antd #183

Closed iloveip closed 5 years ago

iloveip commented 5 years ago

Hi there,

Does this library work with Ant Design Input component? Is there any working example?

I tried to add it following your example like this:

const CustomInput = (props) => (
  <InputMask mask="+7 (999) 999-99-99" value={props.value} onChange={props.onChange}>
    {(inputProps) => <Input {...inputProps} />}
  </InputMask>
);

But it gives an error:

react-input-mask: the following props should be passed to the react-input-mask's component and should not be altered in children's function: disabled

Here is demo https://codesandbox.io/s/react-input-mask-test-e1oog?fontsize=14.

iloveip commented 5 years ago

I've posted this question in #139