Open muhammaddiyor0104 opened 11 months ago
Same error here with Formik 2.4.5 and Storybook 8.0.8. Did you got the problem solved, @muhammaddiyor0104 ?
@muhammaddiyor0104 @rapitkan Please share codesandbox link with the issue
Same issue for me
Had this issue lately.
I have ui lib with build by vite. I didn't have formik added to external in rollupOptions
and it copy all function of formik in build. But of course it have another context and doesn't work with vite.config.ts
. Fixed it for me. Perhaps helps somebody
build: {
rollupOptions: {
external: ['react', 'react-dom', 'styled-components', 'formik'],
output: {
globals: {
react: 'React',
'react-dom': 'ReactDOM',
'styled-components': 'styled',
formik: 'formik',
},
},
},
},
i have my own ui library and my form elements uses useField
but when i install my lib and use my fileds inside of formik i am getting this error Cannot read properties of undefined (reading 'getFieldProps')
what i am doing wrong?