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 ShouldForwardProp option to the twc function #29

Closed
elmarvr opened this issue Dec 28, 2023 · 4 comments · Fixed by #30
Closed

Add ShouldForwardProp option to the twc function #29

elmarvr opened this issue Dec 28, 2023 · 4 comments · Fixed by #30

Comments

@elmarvr
Copy link

elmarvr commented Dec 28, 2023

🚀 Feature Proposal

Add ShouldForwardProp option to the twc function

Motivation

I don't want to use the prefixed props syntax

Example

twc.div(({ variant}) => buttonVariants({ variant} ) , (prop) => prop === "variant"))

@gregberge
Copy link
Owner

You can use https://react-twc.vercel.app/docs/api-reference#createtwc to do that.

@elmarvr
Copy link
Author

elmarvr commented Dec 28, 2023

But isn't it awkward to use the factory for individual components? And what if you also need some global config? Or are you suggesting adding all the different variant keys in a global createTwc?

@gregberge
Copy link
Owner

@elmarvr I will think about a way to customize it locally.

gregberge added a commit that referenced this issue Dec 29, 2023
gregberge added a commit that referenced this issue Dec 29, 2023
Allow to configure transient props for a specific component using the
`transientProps` constructor.

Closes #29
gregberge added a commit that referenced this issue Dec 29, 2023
Allow to configure transient props for a specific component using the
`transientProps` constructor.

Closes #29
@gregberge
Copy link
Owner

@elmarvr thanks for your suggestion, it is now possible: https://react-twc.vercel.app/docs/guides/adapting-based-on-props#customize-transient-props

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 a pull request may close this issue.

2 participants