Fix deprecated type in React 18
Replace StatelessComponent by FunctionComponent in withFormik.tsx fix #3546
PR to solve the problem with the removed type in react 18 I saw that you have a build/types branch, but it hasn't changed since 2020, so I did the direct PR in master
This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployments, click below or on the icon next to each commit.
formik-docs β ./
π Inspect: https://vercel.com/jared/formik-docs/FUtLLMK1DnyNPXEuntzqx4vcQNsz
β
Preview: Failed
Can we get this merged? This is blocking multiple deployments
Can we get this merged please? This is blocking production deployments.
Hi @jaredpalmer / @johnrom - Are you able to provide guidance on what is required to get this pushed through? StatelessComponent has been removed from React 18 after being long ago deprecated.
FYI - <StatelessComponent /> was deprecated in November 2018 (Around React 16.8) in favour of <FunctionalComponent />. See for details: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/30364
All React React 18 projects are now failing. It would be great if we could get this merged in ASAP. I'm happy to help with any tasks required to get this completed
Thanks!
Until then you can define declarations.d.ts:
declare module 'react' {
export interface StatelessComponent<P = {}> extends FunctionComponent<P> {}
}
Thanks, @Poky85 - Yeah that's true but this PR has been open for a couple of months to change of code. It would be great if we could get the PR merged in so that we don't need to use the workaround!
My solution was to move to react-hook-form. If a project canβt even fix basic issues that break type compatibility, people should start looking for alternatives
@eonwhite - Ian - I'm flagging you in here to see if you're able to help us get this moved forward? Thanks
This project is very unlikely to get any future releases, so probably best to look elsewhere.
The latest updates on your projects. Learn more about Vercel for Git βοΈ
| Name | Status | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| formik-docs | β Ready (Inspect) | Visit Preview | π¬ Add feedback | Sep 2, 2023 0:09am |
β οΈ No Changeset found
Latest commit: 7fd6bee911c1336228a99972c50ef646ffc45745
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
This PR includes no changesets
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
This pull request is automatically built and testable in CodeSandbox.
To see build info of the built libraries, click here or the icon next to each commit SHA.
Latest deployment of this branch, based on commit 7fd6bee911c1336228a99972c50ef646ffc45745:
| Sandbox | Source |
|---|---|
| Formik TypeScript Playground (forked) | Configuration |
| interesting-jepsen-lpgrjr | Issue #3546 |
Needs a changeset