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 July 25, 2024 21:04
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),