formik Questions

4

I've a formik form in a component that I'd want to reuse. In order to do that I need to listen to the form values changes in order to call two functions, getFormValues and getFormErrors, that will ...
Dissident asked 23/1, 2022 at 19:28

3

Solved

Problem I have a formik form which needs to have 2 different validation schemas depending on what button the user uses to submit. I have seen some people say use state to decide which one but I wan...
Lukasz asked 20/8, 2022 at 8:20

3

Solved

I just trying to create a custom Formik <Field />. It is a <input type = file /> with opacity=0 and depending of values i styling my <Error /> component and <input type = text ...
Demiurge asked 5/7, 2020 at 9:48

8

Solved

I have form with dynamic amount of inputs (admin email) however checking for uniqueness fails: validationSchema={Yup.object().shape({ adminEmails: Yup.array() .of( Yup.string() .notOneOf(Yup...
Forgo asked 8/1, 2019 at 14:27

5

Solved

I know how to style it with regular form inputs/selects/etc, but I have switched from using those to Formik Field, and the above doesn't work the same way. <Formik initialValues={{ example: '...
Avi asked 19/7, 2019 at 13:30

7

I'm using Yup to validate my form. In one of my form, I want to validate that one <input type="file" /> has a file. I've tested this (and it's not working): Yup.object().shape({ file: Yup....
Regine asked 20/9, 2018 at 14:8

7

Solved

I'm working with a react form validation using Yup along with Formik. There is a react-select element in the form which needs to be validated as well. For validation i'm making use of validationSch...
Manure asked 21/8, 2019 at 14:38

5

Solved

I followed everything from documentation and watched the tutorial by Ben Awad on YouTube. And still, I cannot get it to work. const TextField = (props: FieldHookConfig<{}>) => { const [f...
Detrimental asked 7/4, 2020 at 20:48

4

Solved

I have a formik form for editing data which comes from an API endpoint,currently I am re-initializing the values in a useEffect hook like this React.useEffect(() => { initialValues.first_name =...
Vocalize asked 23/11, 2021 at 9:29

4

Solved

Pretty new with Formik, I have a simple form, which has validation. I need to have 2 buttons, Submit and a Save button which will mostly do the same thing, however, if "Save" button is clicked, I w...
Carlson asked 12/5, 2020 at 10:22

3

In my React/TypeScript app that uses Formik, I am getting the error Object is possibly 'null'. TS2531 125 | <Modal.Footer> > 126 | <Button variant="primary" type="subm...
Resonant asked 10/2, 2021 at 21:17

12

Solved

In Formik, how to make the Reset button reset the form only after confirmation? My code below still resets the form even when you click Cancel. var handleReset = (values, formProps) => { retu...
Memoirs asked 9/4, 2019 at 1:19

3

Solved

I am trying to create a yup schema where based on a variables value the schema changes slightly. In my case depending on the value of prop myCondition I need to make a field as required. I would li...
Adornment asked 6/4, 2020 at 16:20

0

I am trying to make the most efficient reusable wrapper for React-Select possible using typescript and formik, but I get a typescript error that says "type 'true' is not assignable to type 'fa...

7

I have a form using reactjs + formik + yup. I have a multi file upload field. I want to validate the file format and max size using yup. How can I do this?
Pryor asked 3/1, 2019 at 10:43

9

I am now trying to create a form on NextJs 13 (Typescript) with Formik. The form that I created doesn't work then I tried adding the example code snippets from Formik as you could see below. Both t...
Foresheet asked 30/10, 2022 at 17:43

5

Solved

I'm building a form with an auto filling text box using react-select and formik. <Formik initialValues={{ assignedTo: task.assignedTo, }} onSubmit={(values) => { const updatedTask = { ....
Sammy asked 25/7, 2018 at 12:28

4

I have a react formik form, where there is a select field, say the field has values A,B,C,D,E,F. now say, another field , ChooseSubType , only shows up if I choose B or D and this field will only ...
Nephritic asked 11/11, 2018 at 4:18

3

Generally <TextInput> allows you to type even when you're just specifying a placeholder. However, when using within the Formik form, I am unable to type and validate anything in my form. What...
Roadhouse asked 8/5, 2020 at 23:26

2

I am using below versions, "formik": "^2.2.9" "react": "^18.2.0" "react-dom": "^18.2.0" "react-router-dom": "^6.4.0" ...
To asked 5/10, 2022 at 14:44

3

I'm writing a React app and using Formik and Yup for forms. The page I'm having trouble with is a wizard-style page that renders Form1 on page load with a "Next" button on it. Pressing "Next" rende...
The asked 8/5, 2020 at 18:33

3

Solved

I am trying to update a Formik field from a modal screen. The modal returns the data and set them into the pageState. Considering that my Fomik Form has "enableReinitialize", the field update works...
Poteen asked 15/7, 2019 at 15:59

4

I am trying to set auto focus on input fields in a Formik form using React. What is the standard way of doing this? My code is below: <img src="images/barcode-small.png" alt="Barcode Small" /...
Convergent asked 17/6, 2020 at 8:23

17

I am creating a form by using react and formik.Below is my code: <div> <Formik initialValues={{ email: "" }} onSubmit={(values: FState, setSubmitting: any) => { console.log("Ente...
Antoinette asked 19/3, 2019 at 9:25

3

Solved

Hey there I am new to formik library, and I am trying to use react-draft-wysiwyg component with Formik. Here is my code. RichTextEditor.js import React, { useState } from "react"; import ...
Castellanos asked 8/8, 2020 at 7:37

© 2022 - 2025 — McMap. All rights reserved.