-
-
Notifications
You must be signed in to change notification settings - Fork 159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Formik does not work #329
Comments
@HurrellT thanks for reporting, I'll look into it when I can. Are you able to provide a public repo with a reproduction of the issue? That way I could more easily debug it. |
Sure, here's a link https://github.com/HurrellT/formikStorybookTest |
@HurrellT thanks for providing that! when I have some spare time I will give it a try. |
@HurrellT this is caused by this bug: #20 You can get around it by patching some of the storybook packages from upstream. Basically whenever this code is present it breaks all promises
I'll prepare a patch for your project to show how you can get around it. This has been solved in the 6.0 beta, however I understand if you don't want to upgrade yet. |
I made a PR to your example that fixes the issue, just run yarn or npm install and it patches the @storybook/addons package to remove the promise polyfill |
Heres the patch for @storybook/addons in case its useful
|
Thanks a lot @dannyhw you are a hero. I applied the patch in my main project and it works. |
@HurrellT can you tell me how it works with you i tried to add this patch , but get nothing (formik still not work) |
Have you installed patch-package and postinstall-postinstall in your project? |
I did the same, but is not working yet |
Describe the bug
Simply, formik doesn’t work with storybook on a project made with RN CLI, no matter the React Native and Formik version.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Form showing errors when trying to submit or when entering values that doesn’t meet the validations.
onSubmit function working, etc.
Code snippets
System:
Environment Info:
System:
OS: macOS 12.2
CPU: (8) arm64 Apple M1
Binaries:
Node: 16.13.2 - ~/.nvm/versions/node/v16.13.2/bin/node
Yarn: 1.22.15 - ~/.nvm/versions/node/v16.13.2/bin/yarn
npm: 8.1.2 - ~/.nvm/versions/node/v16.13.2/bin/npm
Browsers:
Safari: 15.3
npmPackages:
@storybook/addon-actions: ^5.3 => 5.3.21
@storybook/addon-knobs: ^5.3 => 5.3.21
@storybook/addon-links: ^5.3 => 5.3.21
@storybook/addon-ondevice-actions: ^5.3.23 => 5.3.23
@storybook/addon-ondevice-knobs: ^5.3.25 => 5.3.25
@storybook/react-native: ^5.3.25 => 5.3.25
@storybook/react-native-server: ^5.3.23 => 5.3.23
Additional context
No issues when removing Storybook (replacing the index with the shared component)
The text was updated successfully, but these errors were encountered: