Skip to content

Instantly share code, notes, and snippets.

View Aniganesh's full-sized avatar
🎯
Focusing

Aniruddha Ganesh Aniganesh

🎯
Focusing
View GitHub Profile
@Aniganesh
Aniganesh / App.jsx
Last active March 8, 2022 17:29
How to use formik with multiple fields in the same value
import { Form, Formik } from "formik";
import React, { useState } from "react";
import "./App.css";
/* To view the result in a browser, create a new react app and replace the existing App.jsx file with this file */
function App() {
const [numAddresses, setNumAddresses] = useState(1);
const localStorageAddresses = JSON.parse(
localStorage.getItem("savedAddresses") || "[]"
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.