Skip to content

Instantly share code, notes, and snippets.

@velotiotech
Created June 10, 2020 09:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save velotiotech/8b2bcba5115d3f8485bcafadf3d91054 to your computer and use it in GitHub Desktop.
Save velotiotech/8b2bcba5115d3f8485bcafadf3d91054 to your computer and use it in GitHub Desktop.
import React from 'react';
import { useFormik } from 'formik';
import response from "./apiresponse"
import RecursiveContainer from './RecursiveContainer';
import * as yup from 'yup';
const SignupForm = () => {
const signupSchema = yup.object().shape({
name: yup.string().required()
});
const formik = useFormik({
initialValues: {
},
onSubmit: values => {
alert(JSON.stringify(values, null, 2));
},
validationSchema: signupSchema
});
console.log(formik, response)
return (
<form onSubmit={formik.handleSubmit}>
<RecursiveContainer config={response} formik={formik} />
<button type="submit">Submit</button>
</form>
);
};
export default SignupForm;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment