Skip to content

Instantly share code, notes, and snippets.

View AdamCottrill's full-sized avatar

Adam Cottrill AdamCottrill

  • Owen Sound, Ontario, Canada
View GitHub Profile
@manzoorwanijk
manzoorwanijk / yup-with-final-form.js
Last active August 22, 2024 11:44
How to properly use yup validation schema with (React) Final Form?
import * as yup from 'yup';
import { setIn } from 'final-form';
const validationSchema = yup.object({
email: yup.string().email(),
shipping: yup.object({
name: yup.string(),
phone: yup.object({
code: yup.string().matches(/^\+\d+$/i),
number: yup.number().max(10),