From 47585c39bf8fb6f08460ff496664f388e3d2aa58 Mon Sep 17 00:00:00 2001 From: gratestas Date: Wed, 18 Jan 2023 22:10:25 +0300 Subject: [PATCH 1/4] fix: remove getDerivedStateFromError due to side effect --- src/components/error-boundary.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/components/error-boundary.js b/src/components/error-boundary.js index 47511060..2719730e 100644 --- a/src/components/error-boundary.js +++ b/src/components/error-boundary.js @@ -9,9 +9,6 @@ export default class ErrorBoundary extends Component { this.state = { hasError: false, error: null, errorInfo: null }; } - static getDerivedStateFromError = () => { - return { hasError: true }; - }; componentDidCatch(error, errorInfo) { withScope((scope) => { Object.keys(errorInfo).forEach((key) => { From 843b073b9134a1904c3f3c0c85365d34c27b0c1d Mon Sep 17 00:00:00 2001 From: gratestas Date: Wed, 18 Jan 2023 22:11:32 +0300 Subject: [PATCH 2/4] fix: remove inner error boundary --- src/bootstrap/app.js | 138 ++++++++++++++++++++----------------------- 1 file changed, 65 insertions(+), 73 deletions(-) diff --git a/src/bootstrap/app.js b/src/bootstrap/app.js index 282122a5..89726933 100644 --- a/src/bootstrap/app.js +++ b/src/bootstrap/app.js @@ -15,8 +15,6 @@ import { ChainIdProvider } from "../hooks/use-chain-id"; import { ArchonInitializer } from "./archon"; import ChainChangeWatcher from "./chain-change-watcher"; import drizzle, { DrizzleProvider, Initializer, useDrizzle } from "./drizzle"; -import ErrorBoundary from "../components/error-boundary"; -import SwitchChainFallback from "../components/error-fallback/switch-chain"; export default function App() { const [isMenuClosed, setIsMenuClosed] = useState(true); @@ -28,81 +26,75 @@ export default function App() { - } - loadingContractsAndAccounts={} - loadingWeb3={} - > + } loadingWeb3={}> - - - + + + + setIsMenuClosed((previousState) => !previousState)} + > + {MenuItems} + - setIsMenuClosed((previousState) => !previousState)} - > - {MenuItems} - - - - - - - - - - - - {MenuItems} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -