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

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

myNameIsDu
Copy link

@myNameIsDu myNameIsDu commented Sep 14, 2023

Close #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
Copy link

changeset-bot bot commented Sep 14, 2023

🦋 Changeset detected

Latest commit: fb09a09

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
Copy link

vercel bot commented Sep 14, 2023

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
Copy link

codesandbox-ci bot commented Sep 14, 2023

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

Sandbox Source
Formik TypeScript Playground (forked) Configuration

@myNameIsDu myNameIsDu changed the title fix: fix Field allways passes a undefined className to custom component fix: Field allways passes a undefined className to custom component Sep 14, 2023
@colin-oos
Copy link

Any update on this?

@colin-oos
Copy link

Bumping this again. This really needs to get merged. Currently you are not able to style custom components because className on the custom component is always undefined.

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