Created
August 30, 2021 22:03
-
-
Save jrolfs/7828679595981cc4096127ed0a20c077 to your computer and use it in GitHub Desktop.
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 { | |
useToast as useChakraToast, | |
useMultiStyleConfig, | |
} from '@chakra-ui/react'; | |
type UseToastOptions = Omit<ChakraUseToastOptions, 'render'>; | |
const useToast = (hookOptions: ChakraUseToastOptions) => { | |
const chakraToast = useChakraToast(); | |
return (options: OurUseToastOptions) => | |
toast({ | |
render: props => /* render our Alert + translate `isClosable` to `showClose` etc. <Alert {...hookOptions} {..options} /> */ | |
}); | |
}; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment