This repository has been archived by the owner on Jan 23, 2024. It is now read-only.
hi i have a problem in card component #273
-
i wanna create a component for card and for example i wanna pass onclick or background or ... in typescript |
Beta Was this translation helpful? Give feedback.
Answered by
noobinthisgame
Feb 5, 2022
Replies: 1 comment
-
Hey @Kourosh-MD :) export const Card : FunctionComponent<BoxProps> = ({children, ...props}: BoxProps) => {
return <Box {...props}>{children}</Box>
} This way you can use all BoxProps on your custom card component and they will be passed down. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
nikolovlazar
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey @Kourosh-MD :)
you can pass the props of the component you are using to build the custom card component like this:
This way you can use all BoxProps on your custom card component and they will be passed down.