renato-bohler / redux-form-input-masks

Input masking with redux-form made easy
https://bohler.dev/redux-form-input-masks/
MIT License
138 stars 10 forks source link

Typescript error when updating from 1.3 to latest #73

Closed cosmosdesigner closed 2 years ago

cosmosdesigner commented 5 years ago

What are you reporting?

What is the current behavior?

ERROR: (alias) class Field<P = InputHTMLAttributes | SelectHTMLAttributes | TextareaHTMLAttributes | BaseFieldProps<{}>> import Field Type '{ format: (storeValue: ReactText) => string; normalize: (updatedValue: string, previousValue: ReactText) => ReactText; onChange: (event: Event) => void; onFocus: (event: Event) => void; autoComplete: string; name: "number"; component: "input"; type: string; }' is not assignable to type 'Readonly<BaseFieldProps<{ format: (storeValue: ReactText) => string; normalize: (updatedValue: string, previousValue: ReactText) => ReactText; onChange: (event: Event) => void; onFocus: (event: Event) => void; autoComplete: string; name: "number"; component: "input"; type: string; }> & { ...; }>'. Types of property 'onChange' are incompatible. Type '(event: Event) => void' is not assignable to type 'EventWithDataHandler<ChangeEvent> & ((event: Event) => void)'. Type '(event: Event) => void' is not assignable to type 'EventWithDataHandler<ChangeEvent>'. Types of parameters 'event' and 'event' are incompatible. Type 'ChangeEvent' is missing the following properties from type 'Event': cancelBubble, composed, returnValue, srcElement, and 7 more.

What is the expected behavior?

Not having this error

Sandbox Link

https://zl27211yyx.codesandbox.io/

https://codesandbox.io/s/zl27211yyx

on userForm.tsx file

Thank you :)

jcspader commented 2 years ago

The same problem here.

"react": "^16.8.6", "redux": "^4.0.1", "redux-form": "^8.1.0", "redux-form-input-masks": "^2.0.1",

renato-bohler commented 2 years ago

Fixed by https://github.com/renato-bohler/redux-form-input-masks/pull/127