Created
October 4, 2021 21:34
-
-
Save omsharp/f87080efba759a9267af4a8f58d27f04 to your computer and use it in GitHub Desktop.
An example on how to extend components with props (eg: Chakra UI)
This file contains hidden or 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 { Text, TextProps } from '@chakra-ui/react'; | |
| //! A good example on how to extend chakra ui components | |
| export const ValidationErrorText: React.FC<TextProps> = ({ | |
| children, | |
| ...props | |
| }) => { | |
| return ( | |
| <Text fontSize="sm" color="red.500" {...props}> | |
| {children} | |
| </Text> | |
| ); | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment