stackworx / formik-mui

Bindings for using Formik with Material-UI

Home Page:https://stackworx.github.io/formik-mui

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[TypeScript] Override value for TextField

ypresto opened this issue · comments

I have a TextField with its value is number | null, where null is for empty value.
TextField warns for null value so I want to convert it to '' by passing value.

But currently TextField type is

export interface TextFieldProps extends FieldProps, Omit<MuiTextFieldProps, 'name' | 'value' | 'error'> {

So type check fails when value prop is passed, while it works well for runtime.

Can I remove "omit name" from the type declaration?

This should be solved with initialValues