diff --git a/src/components/common/ErrorBoundry.module.css b/src/components/common/ErrorBoundary.module.css similarity index 100% rename from src/components/common/ErrorBoundry.module.css rename to src/components/common/ErrorBoundary.module.css diff --git a/src/components/common/ErrorBoundary.tsx b/src/components/common/ErrorBoundary.tsx index 4eb2700f..49b7e671 100644 --- a/src/components/common/ErrorBoundary.tsx +++ b/src/components/common/ErrorBoundary.tsx @@ -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 }) => { diff --git a/tsconfig.json b/tsconfig.json index 1807e947..390c8b13 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -23,6 +23,7 @@ "incremental": false, "baseUrl": "./src", "paths": { + "react": ["./node_modules/@types/react"], "assets/*": ["./assets/*"], "components/*": ["./components/*"], "lib/*": ["./lib/*"],