fix: change build browserslist to fix BigInt native compatibiltiy

This commit is contained in:
MTG2000
2022-07-24 15:52:18 +03:00
parent ff9c13481f
commit 1eba3fed81
3 changed files with 50 additions and 10 deletions

View File

@@ -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",

View 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;

View File

@@ -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}