Skip to content

Can't extending styles #2793

Answered by srmagura
MuttakinHasib asked this question in Q&A
Jun 23, 2022 · 2 comments · 1 reply
Discussion options

You must be logged in to vote

If you do console.log(rest), you will see it contains a className property. So when you do {...rest}, it overwrites

className={`${props.className} block border bg-brand/5 border-brand/[0.04] focus:bg-slate-50 focus:border-brand focus:outline-none focus:ring-0 w-96  rounded`}`

Fix:

-const { name, label, options, children, ...rest } = props
+const { name, label, options, className, children, ...rest } = props

Replies: 2 comments 1 reply

This comment was marked as spam.

Comment options

You must be logged in to vote
1 reply
@MuttakinHasib
Comment options

Answer selected by MuttakinHasib
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