mirror of
https://github.com/aljazceru/landscape-template.git
synced 2025-12-26 18:54:21 +01:00
fix: change build browserslist to fix BigInt native compatibiltiy
This commit is contained in:
@@ -135,9 +135,11 @@
|
||||
},
|
||||
"browserslist": {
|
||||
"production": [
|
||||
">0.2%",
|
||||
"not dead",
|
||||
"not op_mini all"
|
||||
"chrome >= 67",
|
||||
"edge >= 79",
|
||||
"firefox >= 68",
|
||||
"opera >= 54",
|
||||
"safari >= 14"
|
||||
],
|
||||
"development": [
|
||||
"last 1 chrome version",
|
||||
|
||||
35
src/Components/ErrorBoundary/ErrorBoundary.tsx
Normal file
35
src/Components/ErrorBoundary/ErrorBoundary.tsx
Normal file
@@ -0,0 +1,35 @@
|
||||
import React, { Component, ErrorInfo, ReactNode } from "react";
|
||||
|
||||
interface Props {
|
||||
place?: string
|
||||
children?: ReactNode;
|
||||
}
|
||||
|
||||
interface State {
|
||||
hasError: boolean;
|
||||
}
|
||||
|
||||
class ErrorBoundary extends Component<Props, State> {
|
||||
public state: State = {
|
||||
hasError: false
|
||||
};
|
||||
|
||||
public static getDerivedStateFromError(_: Error): State {
|
||||
// Update state so the next render will show the fallback UI.
|
||||
return { hasError: true };
|
||||
}
|
||||
|
||||
public componentDidCatch(error: Error, errorInfo: ErrorInfo) {
|
||||
console.error(`Uncaught error at ${this.props.place}`, error, errorInfo);
|
||||
}
|
||||
|
||||
public render() {
|
||||
if (this.state.hasError) {
|
||||
return <h1>Sorry.. there was an error</h1>;
|
||||
}
|
||||
|
||||
return this.props.children;
|
||||
}
|
||||
}
|
||||
|
||||
export default ErrorBoundary;
|
||||
@@ -12,6 +12,7 @@ import ReactTooltip from 'react-tooltip';
|
||||
import 'react-multi-carousel/lib/styles.css';
|
||||
import 'react-loading-skeleton/dist/skeleton.css'
|
||||
import THEME from './theme';
|
||||
import ErrorBoundary from 'src/Components/ErrorBoundary/ErrorBoundary';
|
||||
THEME.injectStyles();
|
||||
|
||||
let basename = '/';
|
||||
@@ -42,13 +43,15 @@ export default function Wrapper(props: any) {
|
||||
|
||||
return (
|
||||
<>
|
||||
<ApolloProvider client={apolloClient}>
|
||||
<Provider store={store}>
|
||||
<BrowserRouter basename={basename}>
|
||||
{props.children}
|
||||
</BrowserRouter>
|
||||
</Provider>
|
||||
</ApolloProvider>
|
||||
<ErrorBoundary place='app'>
|
||||
<ApolloProvider client={apolloClient}>
|
||||
<Provider store={store}>
|
||||
<BrowserRouter basename={basename}>
|
||||
{props.children}
|
||||
</BrowserRouter>
|
||||
</Provider>
|
||||
</ApolloProvider>
|
||||
</ErrorBoundary>
|
||||
<ReactTooltip
|
||||
effect='solid'
|
||||
delayShow={1000}
|
||||
|
||||
Reference in New Issue
Block a user