creating user in db is working with fields and all

This commit is contained in:
talksik
2022-05-28 12:02:22 -05:00
parent 7c05f27199
commit 17c0df1d84
6 changed files with 135 additions and 45 deletions
@@ -0,0 +1,36 @@
import React from 'react';
import { ErrorBoundary } from 'react-error-boundary';
import { useSnackbar } from 'notistack';
function MyFallbackComponent({
error,
resetErrorBoundary,
}: {
error: Error;
resetErrorBoundary: () => void;
}) {
return (
<div role="alert">
<p>Something went wrong:</p>
<pre>{error.message}</pre>
<button onClick={resetErrorBoundary}>Try again</button>
</div>
);
}
export default function ErrorParent({ children }: { children: React.ReactNode }) {
const { enqueueSnackbar } = useSnackbar();
return (
<ErrorBoundary
FallbackComponent={MyFallbackComponent}
onError={(error, errorInfo) => enqueueSnackbar(error.message, { variant: 'error' })}
onReset={() => {
// reset the state of your app
}}
>
{children}
</ErrorBoundary>
);
}