Last active
September 15, 2022 08:14
-
-
Save Pagebakers/33efe198b6f2f24cd59d54120ba4f770 to your computer and use it in GitHub Desktop.
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 { ThemeTypings, useTheme } from '@chakra-ui/react' | |
export const useDefaultProps = <ThemeKey = keyof ThemeTypings>( | |
componentName: ThemeKey, | |
) => { | |
const theme = useTheme() | |
return theme.components[componentName]?.defaultProps || {} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment