build: format the code with prettier

This commit is contained in:
Tristan Yang
2023-05-19 16:31:28 +08:00
parent 7afc132bbb
commit 5bd0183651
259 changed files with 7627 additions and 5607 deletions
+17 -19
View File
@@ -1,27 +1,25 @@
import React, { ReactNode } from 'react';
import React, { ReactNode } from "react";
import { ErrorBoundary } from "react-error-boundary";
type FallbackProps = {
error: Error,
resetErrorBoundary: (...args: Array<unknown>) => void
}
error: Error;
resetErrorBoundary: (...args: Array<unknown>) => void;
};
function ErrorFallback({ error, resetErrorBoundary }: FallbackProps) {
return (
<div role="alert" className='text-lg text-red-600'>
<p>Something went wrong:</p>
<pre>{error.message}</pre>
<button onClick={resetErrorBoundary}>Try again</button>
</div>
);
return (
<div role="alert" className="text-lg text-red-600">
<p>Something went wrong:</p>
<pre>{error.message}</pre>
<button onClick={resetErrorBoundary}>Try again</button>
</div>
);
}
type Props = {
children: ReactNode
}
const ErrorCatcher = ({ children }: Props) => {
return (
<ErrorBoundary FallbackComponent={ErrorFallback}>{children}</ErrorBoundary>
);
children: ReactNode;
};
export default ErrorCatcher;
const ErrorCatcher = ({ children }: Props) => {
return <ErrorBoundary FallbackComponent={ErrorFallback}>{children}</ErrorBoundary>;
};
export default ErrorCatcher;