Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export const useToast = () => {
const treatTheme = useTheme();
const addToast = useContext(ToastControllerContext);
if (addToast === null) {
throw new Error('No "ToastProvider" configured');
}
return (props: Omit) =>
addToast({ ...props, treatTheme, id: `${toastCounter++}` });
};