Category "formik"

(Yup) how to create multiple errors using a single .test() function

EDIT: while the accepted solution worked, this worked much better in my use case I have one function that validates that neither input field A nor input field B

ReactJS Formik display error message in Red color

In ReactJS i am developing one Class component and using Formik for validation. I am able to do validation but error message is display as a normal color (blac

onChange on TextInput Not Working Inside Formik

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 a

Google Tag Manager Form Submission with Formik

Try as I may, I am unable to successfully track any form submissions with Google Tag Manager when the form is submitted by Formik in a React project. I have tr

Yup / Formik async validation with debounce

How can debounce be applied to the async validation below (code from Yup's github) ? let asyncJimmySchema = string().test( 'is-jimmy', '${path} is not Jimm

Formik Validation in a Field Array

I have a formik form like this:- import Drawer from "components/atoms/Drawer"; /* import Input from "components/atoms/Input"; import InputGroup from "component

The resetForm method of Formik does not work as expected

I'm using Formik in my application and I want to cancel changes made to a form and revert it to its initial values (this is not about clearing form after submit

Validating file size and format with YUP

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?

Formik Initial Values out of Sync with Redux

This form is used to edit a user profile. It should load with up to date user data for the initial values. To handle this, I've added a redux fetchUser action i

get value when updated,outside of formik using useRef()

I'm trying to get the value of an autocomplete field outside of my formik component everytime it changes, and i did something like this: const formRef=useRef<

Typescript Equality issue on Material UI Autocomplete

Data is stored as: { iso: "gb", label: "United Kingdom", country: "United Kingdom" }, { iso: "fr", label: "France", country: "France" } Value passed to the

How do I access current value of a formik field without submitting?

How do I access value of the SelectField named countryCode in my React component? Use case is that validation scheme should change according to the countryCode.

Why do I get a 401 unauthorized error when logging in?

I am using the NextAuth.js credentials provider for the log in procedure. When logging in I am catching the errors in a try-catch block and set the error state

SetValues Formik Function disables Formik HandleSubmit

I have a form that can handle submission a couple of different ways. The difference is managed by a flag in the form Values that can either be true or false. I

TextareaAutosize With Formik?

I am using react-textarea-autosize and formik and I am wondering how to properly hook the change events of formik to TextareaAutosize? <Formik

Formik onSubmit function is not working on my code

I am creating a form by using react and formik.Below is my code: <div> <Formik initialValues={{ email: "" }} onSubmit={(values: FS

In React with Formik how can I build a search bar that will detect input value to render the buttons?

New to Formik and React I've built a search component that I'm having issues with the passing of the input value and rendering the buttons based on input length

Validating file presence with YUP

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 workin

Yup / Formik validation using dynamic keys

I am trying to validate a form with a dynamic amount of fields - i.e., data is returned from an API that determines how many rows are shown, and for each row th

Formik form submitting empty object

I'm new to react and Formik and I'm trying to create a login form. For some reason, the request to the API is sent as the default initial object I created. Here