feat: added error boundary for each page so errors don't crash the whole app (#84)

This commit is contained in:
Vojtech Simetka
2021-04-27 12:53:44 +02:00
committed by GitHub
parent fdecc67acc
commit fdc5f64883
2 changed files with 40 additions and 2 deletions
+5 -2
View File
@@ -1,4 +1,5 @@
import React, { useState, useEffect, ReactElement } from 'react'
import { useState, useEffect, ReactElement } from 'react'
import ErrorBoundary from '../components/ErrorBoundary'
import { createStyles, Theme, makeStyles } from '@material-ui/core/styles'
@@ -71,7 +72,9 @@ const Dashboard = (props: Props): ReactElement => {
<div>
<SideBar {...props} themeMode={themeMode} health={health} nodeHealth={nodeHealth} />
<NavBar themeMode={themeMode} />
<main className={classes.content}>{props.children}</main>
<ErrorBoundary>
<main className={classes.content}>{props.children}</main>
</ErrorBoundary>
</div>
)
}