Skip to content
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

Add forwardref to Formik #2209

Closed
wants to merge 3 commits into from
Closed

Add forwardref to Formik #2209

wants to merge 3 commits into from

Conversation

drivasperez
Copy link
Contributor

Tentatively solves #2208, maybe.

@vercel
Copy link

vercel bot commented Jan 14, 2020

This pull request is being automatically deployed with ZEIT Now (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://zeit.co/jared/formik-docs/3y2gu8pbq
✅ Preview: https://formik-docs-git-fork-drivasperez-forwardref.jared.now.sh

@jaredpalmer
Copy link
Owner

This doesn't work AFAICT because of the generics.

https://github.com/jaredpalmer/formik/pull/2209/checks?check_run_id=389788052#step:5:128

@drivasperez
Copy link
Contributor Author

Yeah, I realised as soon as I made the PR. I should have run the tests locally before pushing, sorry.

Trying some really hair-raising things with casting before work, but have run out of time for the moment. Starting to think innerRef is just the better solution.

@drivasperez
Copy link
Contributor Author

@jaredpalmer This now builds and passes the existing tests, and if you pass a ref, it gets the formikbag. Is the codesandbox environment broken, or have I done something wrong?

@jaredpalmer
Copy link
Owner

Codesandbox is broken.

@drivasperez
Copy link
Contributor Author

Ah, okay. Do you think something like this is worth the typescript weirdness?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants