Skip to content

Get tw as prop from component #510

Answered by ben-rogerson
ddanielcruzz asked this question in Q&A
Discussion options

You must be logged in to vote

Hey!

Try passing className down onto the html element:

const Component = ({ className }) => <section {...{ className }}>hello</section>

<Component tw="text-green-500" />

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@ddanielcruzz
Comment options

@ben-rogerson
Comment options

Answer selected by ddanielcruzz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants