Components Props and Text
Hey mates!
I need to know 2 things
1. How can I add required props? 2. How can I add text to a Component like in the Example?
example:
6 Replies
1. Depends on how your
ButtonProps
is defined
2. You can use props.children
which can be defined in your ButtonProps
via
I think zod has a
.required()
or you can do type ButtonProps = Required<z.infer<typeof ButtonSchema>>
this one works
but the 2. doesnt work
yeah I think it's cause zod is being used
You should be able to do this
this works thank you