-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add error boundary for components (#545)
* add error handling * change message * update docs
- Loading branch information
1 parent
6d11b16
commit 2a174a5
Showing
5 changed files
with
51 additions
and
1 deletion.
There are no files selected for viewing
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
12 changes: 12 additions & 0 deletions
12
client/src/pages/RefreshNotification/RefreshNotification.story.tsx
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,12 @@ | ||
import type { Meta, StoryObj } from "@storybook/react" | ||
import RefreshNotification from "./RefreshNotification" | ||
const meta: Meta<typeof RefreshNotification> = { | ||
component: RefreshNotification | ||
} | ||
|
||
export default meta | ||
type Story = StoryObj<typeof meta> | ||
|
||
export const DefaultRefreshNotification: Story = { | ||
args: {} | ||
} |
16 changes: 16 additions & 0 deletions
16
client/src/pages/RefreshNotification/RefreshNotification.tsx
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,16 @@ | ||
/** | ||
* Used for if there is a lazy load error due to a chunk not being found | ||
* | ||
* Also catches any unhandled errors | ||
*/ | ||
const RefreshNotification = () => { | ||
return ( | ||
<div className="flex h-screen w-full items-center justify-center"> | ||
<h2 className="text-dark-blue-100"> | ||
Something went wrong. Please refresh the page | ||
</h2> | ||
</div> | ||
) | ||
} | ||
|
||
export default RefreshNotification |
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