-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
121 add react error boundary to app between navbar (#143)
* feat(frontend): install react error boundary * feat(frontend): ✨ create an error boundary compoennt and add to root layout * run prettier with tailwind plugin
- Loading branch information
Magnus Alexander Strømseng
authored and
GitHub
committed
Mar 18, 2024
1 parent
04349f8
commit 28332c5
Showing
4 changed files
with
40 additions
and
1 deletion.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| "use client"; | ||
| import React from "react"; | ||
|
|
||
| import { ErrorBoundary } from "react-error-boundary"; | ||
|
|
||
| export default function ErrorBoundaryNavigation({ | ||
| children, | ||
| }: { | ||
| children: React.ReactNode; | ||
| }) { | ||
| return ( | ||
| <ErrorBoundary | ||
| fallback={ | ||
| <div className="flex h-[calc(100vh-36px)] items-center justify-center"> | ||
| Something went wrong loading this page. | ||
| </div> | ||
| } | ||
| > | ||
| {children} | ||
| </ErrorBoundary> | ||
| ); | ||
| } |