import React from 'react'; import { ErrorBoundary } from 'react-error-boundary'; import { useSnackbar } from 'notistack'; function MyFallbackComponent({ error, resetErrorBoundary, }: { error: Error; resetErrorBoundary: () => void; }) { return (

Something went wrong:

{error.message}
); } export default function ErrorParent({ children }: { children: React.ReactNode }) { const { enqueueSnackbar } = useSnackbar(); return ( enqueueSnackbar(error.message, { variant: 'error' })} onReset={() => { // reset the state of your app }} > {children} ); }