Update ErrorBoundary.

This commit is contained in:
Mike Cao 2023-12-03 21:19:03 -08:00
parent f3657685d1
commit a6968e2f70
3 changed files with 4 additions and 7 deletions

View File

@ -1,19 +1,15 @@
/* eslint-disable no-console */
import { ErrorInfo, ReactNode } from 'react';
import { ErrorBoundary as Boundary } from 'react-error-boundary';
import { Button } from 'react-basics';
import useMessages from 'components/hooks/useMessages';
import styles from './ErrorBoundry.module.css';
import styles from './ErrorBoundary.module.css';
const logError = (error: Error, info: ErrorInfo) => {
// eslint-disable-next-line no-console
console.error(error, info.componentStack);
};
export interface ErrorBoundaryProps {
children: ReactNode;
}
export function ErrorBoundary({ children }: ErrorBoundaryProps) {
export function ErrorBoundary({ children }: { children: ReactNode }) {
const { formatMessage, messages } = useMessages();
const fallbackRender = ({ error, resetErrorBoundary }) => {

View File

@ -23,6 +23,7 @@
"incremental": false,
"baseUrl": "./src",
"paths": {
"react": ["./node_modules/@types/react"],
"assets/*": ["./assets/*"],
"components/*": ["./components/*"],
"lib/*": ["./lib/*"],