Reopened #894 because it was closed by mistake
@jaredpalmer Please try out the branch and look the picture of the error I took. As you can see the crash wasn't because of wrong documentation. So please don't close this before validating :)
When using Formik with React Native the app will crash. Here is minimal code for reproduction https://github.com/henrikra/formikTest/blob/master/App.js

Make fresh React Native project and add the code from example: https://jaredpalmer.com/formik/docs/guides/react-native
I expect the app not to crash when using Formik
I have no idea how to solve this at the moment. Looks like React Native doesn't have context object?
Here is minimal reposity to reproduce this crash: https://github.com/henrikra/formikTest/blob/master/App.js
Can you make an expo snack to reproduce this?
Cc @browniefed . Any thoughts?
@jaredpalmer Expo is not needed because here is the small repo that reproduces this: https://github.com/henrikra/formikTest/blob/master/App.js Link is already in the issue
That particular version of React Native is running on an older version of React. Guessing some weird context resolution stuff is causing the issue then.
What React version is preferred with Formik?
Expo is usually running on an older React, in this case it's still running on "react": "16.3.1".
Based on release notes (https://github.com/jaredpalmer/formik/releases/tag/v1.2.0) looks like things were fixed/reconfigured to work with upgraded v16.4 of React.
Not 100% certain that's what we're seeing here, but that seems like a likely cause.
@browniefed it _should_ be backwards compat because we use create-react-context but idk.
Getting similar issue, I put the sample code in my project and it crashes right away with similar error message.
Code be related to react-native version? or react version?
"formik": "^1.3.1",
"react": "^16.4.0",
"react-dom": "^16.4.0",
"react-native": "0.54.4",

Can you share your code?
@simonso-nzme Make a small repo to github with crashing code?
@jaredpalmer Did you try my repro repo https://github.com/henrikra/formikTest ?
@jaredpalmer @henrikra
I checked out @henrikra's test repo and I encountered the exact same issue in my project.
My initial thought was probably something to do with the react native version v0.54.4 as both of us are using v0.54.4 and the error was throwing at ReactNativeRenderer.
So I've done a few tests, I upgraded the version to v0.56.1 on Henrik's repo and in order to make it compile I also have to upgrade "babel-preset-react-native" to "5.0.2".
so the following works:
...
"dependencies": {
"formik": "^1.2.0",
"react": "16.5.0",
"react-native": "0.56.1"
},
"devDependencies": {
"babel-jest": "23.6.0",
"babel-preset-react-native": "5.0.2",
"jest": "23.6.0",
"react-test-renderer": "16.5.0"
...
Now v0.54.4 to v0.56.1 is quite a big jump in terms of upgrading my project (a few breaking changes here and there; dropping iOS 8 support etc), I was hoping to see if Formik can support 'slightly' older version of react-native
Thanks!
While we are on the same topic, I just done further research.
It is still possible to remain v0.54.4 BUT have to revert react version to "react": "16.3.0"
since: 16.3.1+ changed the way context works
@simonso-nzme Very good research!
@jaredpalmer Do you know where Formik is using context in breaking way? Are we able to add support for bit older React Native now with these information? 馃槂
I just tried @simonso-nzme workaround by downgrading React to 16.3.0 the project now compiles. So is there something Formik can do to fix this?
Is this something to do with create-react-context package that formik is using
Hola! So here's the deal, between open source and my day job and life and what not, I have a lot to manage, so I use a GitHub bot to automate a few things here and there. This particular GitHub bot is going to mark this as stale because it has not had recent activity for a while. It will be closed if no further activity occurs in a few days. Do not take this personally--seriously--this is a completely automated action. If this is a mistake, just make a comment, DM me, send a carrier pidgeon, or a smoke signal.
ProBot automatically closed this due to inactivity. Holler if this is a mistake, and we'll re-open it.