mirror of
https://github.com/kremalicious/umami.git
synced 2024-11-16 02:05:04 +01:00
Update ErrorBoundary.
This commit is contained in:
parent
f3657685d1
commit
a6968e2f70
@ -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 }) => {
|
||||
|
@ -23,6 +23,7 @@
|
||||
"incremental": false,
|
||||
"baseUrl": "./src",
|
||||
"paths": {
|
||||
"react": ["./node_modules/@types/react"],
|
||||
"assets/*": ["./assets/*"],
|
||||
"components/*": ["./components/*"],
|
||||
"lib/*": ["./lib/*"],
|
||||
|
Loading…
Reference in New Issue
Block a user