Remix js and formik? #3537
Unanswered
danielefinocchiaro
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I am following both the official docs and various tutorials on the web but my formik doesn't work. If I follow the instructions of the docs with create-react-app it's ok, but in my project i would use remix js. If I do a copy an paste of my code with remix doesn't work. Anyone have used both libraries?
In particular the code below doesn't update initial values when I do a change.
My code
`
import React, { useEffect } from "react";
import ReactDOM from "react-dom";
import { Formik, Form, useField, useFormikContext, useFormik } from "formik";
export default function SignupForm() {
const formik = useFormik({
initialValues: { firstName: "", lastName: "", email: "" },
onSubmit: (values) => {
console.log(values, "values");
},
enableReinitialize: true,
});
console.log(formik.values, "formik.values");
return (
<>
Subscribe!
);
}
`
Beta Was this translation helpful? Give feedback.
All reactions