Skip to content

Instantly share code, notes, and snippets.

View blentz100's full-sized avatar
🎯
Focusing

Brendan Lentz blentz100

🎯
Focusing
View GitHub Profile
@vicasas
vicasas / FieldArray.jsx
Created June 6, 2020 20:55
Example of how to create a dynamic array form using Formik 🙌
import React from "react";
import { Divider, Button, TextField } from "@material-ui/core";
import { makeStyles } from "@material-ui/core/styles";
import { FieldArray, Form, Formik, getIn } from "formik";
import * as Yup from "yup";
const validationSchema = Yup.object().shape({
people: Yup.array().of(
Yup.object().shape({
firstName: Yup.string().required("First name is required"),