You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There does not seem to be a method useFormik or useFormikContext, despite 'FormikProvider' not breaking anything.
Expected behavior
useFormik should be a function
useFormikContext should be a function
Reproducible example
FormItem.jsx
constFormItem=(props)=>{constformikProps=useFormikContext();// useFormikContext is not a function (but its wrapped in Provider - see below)}
FormWrapper.jsx
importReactfrom"react";import{Form,useFormik,Formik,FormikProvider}from"formik";importPropTypesfrom"prop-types";importFormItemfrom"./FormItem";constMyForm=()=>{// Can't use useFormik here. It says useFormik is not a function.// const formik = useFormikreturn(<FormikinitialValues={{first_name: "",last_name: "",phone_number: "",}}><Form><FormikProvider>{/* this does not cause an error, so I would asume useFomik should work on next page */}<FormItem/></FormikProvider></Form></Formik>);};exportdefaultMyForm;
Suggested solution(s)
?
Additional context
?
Your environment
Software
Version(s)
Formik
1.5.8
React
17
TypeScript
NO
Browser
chrome
npm/Yarn
yarn 1.22
Operating System
ubuntu
The text was updated successfully, but these errors were encountered:
Bug report
Current Behavior
There does not seem to be a method useFormik or useFormikContext, despite 'FormikProvider' not breaking anything.
Expected behavior
Reproducible example
FormItem.jsx
FormWrapper.jsx
Suggested solution(s)
?
Additional context
?
Your environment
The text was updated successfully, but these errors were encountered: