formik icon indicating copy to clipboard operation
formik copied to clipboard

Fix deprecated type in React 18

Open alaanescobedo opened this issue 3 years ago β€’ 9 comments

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

alaanescobedo avatar Apr 15 '22 17:04 alaanescobedo

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

vercel[bot] avatar Apr 15 '22 17:04 vercel[bot]

Can we get this merged? This is blocking multiple deployments

Alcas1 avatar May 10 '22 06:05 Alcas1

Can we get this merged please? This is blocking production deployments.

kanishkad avatar May 12 '22 20:05 kanishkad

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!

colebowl avatar Jun 16 '22 20:06 colebowl

Until then you can define declarations.d.ts:

declare module 'react' {
  export interface StatelessComponent<P = {}> extends FunctionComponent<P> {}
}

Poky85 avatar Jun 23 '22 12:06 Poky85

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!

colebowl avatar Jun 23 '22 20:06 colebowl

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

Alcas1 avatar Jun 23 '22 21:06 Alcas1

@eonwhite - Ian - I'm flagging you in here to see if you're able to help us get this moved forward? Thanks

colebowl avatar Jun 27 '22 15:06 colebowl

This project is very unlikely to get any future releases, so probably best to look elsewhere.

johnrom avatar Jun 27 '22 18:06 johnrom

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

vercel[bot] avatar May 26 '23 20:05 vercel[bot]

⚠️ 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

changeset-bot[bot] avatar May 26 '23 20:05 changeset-bot[bot]

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

codesandbox-ci[bot] avatar May 26 '23 20:05 codesandbox-ci[bot]

Needs a changeset

quantizor avatar Sep 02 '23 12:09 quantizor