jaredpalmer / formik

Build forms in React, without the tears 😭
https://formik.org
Apache License 2.0
33.71k stars 2.77k forks source link

fix: Field allways passes a undefined className to custom component #3884

Open myNameIsDu opened 9 months ago

myNameIsDu commented 9 months ago

Close https://github.com/jaredpalmer/formik/issues/3883

The current issue stems from a specific PR, The original issue can be found here

There are some explanations

  1. PR is a little unusual, because the className prop was already included by props, and this style of writing (extracting it from props and then passing it into children's props alone) will cause there's always a className in children's props
  2. The original issue is confusing, because the className is already passed, except that there's no declaration.

Then there are three revisions in this PR

  1. Delete extracted className, but keep the type declaration
  2. Add test cases
  3. Fix the wrong usage of cases function in the test cases before by the way
changeset-bot[bot] commented 9 months ago

🦋 Changeset detected

Latest commit: fb09a097957e31f8001d2f4c0f4da3d0eb89c589

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages | Name | Type | | ------------- | ----- | | formik | Patch | | formik-native | Patch |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

vercel[bot] commented 9 months ago

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 14, 2023 8:21am
codesandbox-ci[bot] commented 9 months ago

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 fb09a097957e31f8001d2f4c0f4da3d0eb89c589:

Sandbox Source
Formik TypeScript Playground (forked) Configuration
colin-oos commented 9 months ago

Any update on this?