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

withComponent function not supported #53

Open
sabres207 opened this issue Apr 6, 2022 · 1 comment
Open

withComponent function not supported #53

sabres207 opened this issue Apr 6, 2022 · 1 comment

Comments

@sabres207
Copy link

Hey guys, thanks for the awesome library.
I noticed there is no way to pass tw an Element to wrap on the fly.
in styled-components I think you could do it with:

const StyledComponent = styled.div``
StyledComponent.withComponent(OtherComponent)

Got any idea how to use tailwind-styled-component with a component that is decided on runtime?
Thank you!

@MathiasGilson
Copy link
Owner

Doesn't this work?

const StyledComponent = styled.div``
const newComponent = tw(StyledComponent)``

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

No branches or pull requests

2 participants