We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I'm currently facing an issue trying to use react-responsive-select with formik and typescript.
This is how i'm using it:
`
<Select name="tipo" modalCloseButton={<ModalCloseButton />} options={[ { value: 'C', text: 'Clienti' }, { value: 'F', text: 'Fornitori' }, { value: 'V', text: 'Vettori' }, { value: 'R', text: 'Referenti' }, { value: 'A', text: 'Agenti' }, { value: 'O', text: 'Collaboratori' }, { value: 'L', text: 'Altro' }, ]} caretIcon={<CaretIcon />} prefix=" " selectedValue={formik.values.tipoEntry} onChange={newValue => { console.log("onChange", newValue); console.log(formik.values.tipoEntry); formik.handleChange({ target: { value: newValue.value, name: newValue.name } }); }} />
Typescript complains about newValue.value and newValue.name: Property 'value' does not exist on type '{ altered?: boolean | undefined; text?: string | undefined; name?: string | undefined; value?: string | undefined; } | { altered?: boolean | undefined; options: { text?: string | undefined; name?: string | undefined; value?: string | undefined; }[]; }'. Property 'value' does not exist on type '{ altered?: boolean | undefined; options: { text?: string | undefined; name?: string | undefined; value?: string | undefined; }[]; }'. TS2339
Property 'value' does not exist on type '{ altered?: boolean | undefined; text?: string | undefined; name?: string | undefined; value?: string | undefined; } | { altered?: boolean | undefined; options: { text?: string | undefined; name?: string | undefined; value?: string | undefined; }[]; }'. Property 'value' does not exist on type '{ altered?: boolean | undefined; options: { text?: string | undefined; name?: string | undefined; value?: string | undefined; }[]; }'. TS2339
It seems to me something wrong with the type of newValue. Any suggestion?
The text was updated successfully, but these errors were encountered:
Thanks for the example. Let me have a look
Sorry, something went wrong.
Hi @repka3 .
Did you try the Formik example on the demo site?
No branches or pull requests
I'm currently facing an issue trying to use react-responsive-select with formik and typescript.
This is how i'm using it:
`
`
Typescript complains about newValue.value and newValue.name:
Property 'value' does not exist on type '{ altered?: boolean | undefined; text?: string | undefined; name?: string | undefined; value?: string | undefined; } | { altered?: boolean | undefined; options: { text?: string | undefined; name?: string | undefined; value?: string | undefined; }[]; }'. Property 'value' does not exist on type '{ altered?: boolean | undefined; options: { text?: string | undefined; name?: string | undefined; value?: string | undefined; }[]; }'. TS2339
It seems to me something wrong with the type of newValue. Any suggestion?
The text was updated successfully, but these errors were encountered: