-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(react-server): log unexpected error (#273)
- Loading branch information
Showing
8 changed files
with
50 additions
and
30 deletions.
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
22 changes: 22 additions & 0 deletions
22
packages/react-server/examples/basic/src/routes/test/error/layout.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,22 @@ | ||
import type { LayoutProps } from "@hiogawa/react-server/server"; | ||
import { NavMenu } from "../../../components/nav-menu"; | ||
|
||
export default function Layout(props: LayoutProps) { | ||
return ( | ||
<div className="flex flex-col gap-2 p-2"> | ||
<h4 className="font-bold">Error Test</h4> | ||
<NavMenu | ||
className="flex flex-col items-start gap-1" | ||
links={[ | ||
"/test/error/not-found", | ||
"/test/error/server?500", | ||
"/test/error/server?custom", | ||
"/test/error/browser", | ||
"/test/error/use-client", | ||
"/test/error/use-server", | ||
]} | ||
/> | ||
<div>{props.children}</div> | ||
</div> | ||
); | ||
} |
25 changes: 1 addition & 24 deletions
25
packages/react-server/examples/basic/src/routes/test/error/page.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 |
---|---|---|
@@ -1,26 +1,3 @@ | ||
import { Link } from "@hiogawa/react-server/client"; | ||
|
||
export default async function Page() { | ||
return ( | ||
<div className="flex gap-2 p-2"> | ||
<Link | ||
className="antd-btn antd-btn-default px-2" | ||
href="/test/error/server?500" | ||
> | ||
Server 500 | ||
</Link> | ||
<Link | ||
className="antd-btn antd-btn-default px-2" | ||
href="/test/error/server?custom" | ||
> | ||
Server Custom | ||
</Link> | ||
<Link | ||
className="antd-btn antd-btn-default px-2" | ||
href="/test/error/browser" | ||
> | ||
Browser | ||
</Link> | ||
</div> | ||
); | ||
return null; | ||
} |
3 changes: 3 additions & 0 deletions
3
packages/react-server/examples/basic/src/routes/test/error/use-client/page.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,3 @@ | ||
export default function Page() { | ||
return <button onClick={() => {}}>Boom!</button>; | ||
} |
3 changes: 3 additions & 0 deletions
3
packages/react-server/examples/basic/src/routes/test/error/use-server/page.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,3 @@ | ||
export default function Page() { | ||
return <form action={() => {}}>Boom!</form>; | ||
} |
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