Last active
November 10, 2021 12:59
-
-
Save domosedov/01db922d3df4215d2cbeb2b40e7c9a80 to your computer and use it in GitHub Desktop.
React TailwindCSS component example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import type { FC, HTMLAttributes } from "react"; | |
type BoxProps = { | |
as?: keyof JSX.IntrinsicElements; | |
} & HTMLAttributes<HTMLOrSVGElement>; | |
export const Box: FC<BoxProps> = ({ as: Component = "div", ...props }) => { | |
return <Component {...props} />; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment