diff --git a/src/pages/index.tsx b/src/pages/index.tsx index acc3bffc1fe..eb51177a3bd 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -1,4 +1,5 @@ import React from 'react' +import { withErrorBoundary } from './reset-password' import { WithIntl } from 'components/localization' import HomePage from 'features/pages/home' import { SEO } from 'components/containers' @@ -8,7 +9,8 @@ const Home = () => { return } -export default WithIntl()(Home) +export default withErrorBoundary(Home) +WithIntl() export const Head = ({ pageContext }: TGatsbyHead) => ( { + return function ErrorBoundary(props) { + const [error, setError] = useState(null) + if (error) { + return
An error occured:{error.toString()}
+ } + + try { + return + } catch (err) { + setError(err) + } + } +} const ResetPassword = () => { const [apiError, setApiError] = useState('')