jaredpalmer / formik

Build forms in React, without the tears 😭
https://formik.org
Apache License 2.0
33.74k stars 2.77k forks source link

Expo and React Native error: TypeError: (0, _formik.useFormik) is not a function. (In '(0, _formik.useFormik)()', '(0, _formik.useFormik)' is undefined) #3636

Open adiakritos opened 1 year ago

adiakritos commented 1 year ago

Bug report

Current Behavior

In a brand new React Native project that's been set up using expo, I've installed Formik as the only additional package. When attempting to follow the tutorial at https://formik.org/docs/tutorial I import the hook 'use formik' and see the error in the title.

This app only uses the app entry file, no other. Screen Shot 2022-08-29 at 9 59 43 AM

Screen Shot 2022-08-29 at 10 00 17 AM

Screen Shot 2022-08-29 at 10 00 39 AM

Expected behavior

When I import userFormik from 'formik' and use it in the function, it should be able to find useFormik and use it.

Reproducible example

Suggested solution(s)

Additional context

Your environment

Software Version(s)
Formik 2.2.9
React 18.0.0
TypeScript none
Browser none
npm/Yarn 1.22.19
Operating System MacOS Monterey
mr-funtor commented 1 year ago

I'm experiencing the same thing. Have you been able to resolve this?

adiakritos commented 1 year ago

I'm experiencing the same thing. Have you been able to resolve this?

I have not. I just made my own form using react native.

RaGuL2k23 commented 3 weeks ago

im in 2024 still having this problem did no one come up with a solution ?

RaGuL2k23 commented 3 weeks ago

just wasted 1 hour to find out that npx expo start -c this command solved the problem