cloudflare/vinext
Publicmirrored from https://github.com/cloudflare/vinextAvailable
examples/app-router-playground/app/error/error.tsx
23lines · modecode
| 1 | 'use client'; |
| 2 | |
| 3 | import { Boundary } from '#/ui/boundary'; |
| 4 | import Button from '#/ui/button'; |
| 5 | import React from 'react'; |
| 6 | |
| 7 | export default function Error({ error, reset }: any) { |
| 8 | React.useEffect(() => { |
| 9 | console.log('logging error:', error); |
| 10 | }, [error]); |
| 11 | |
| 12 | return ( |
| 13 | <Boundary label="error.tsx" color="red"> |
| 14 | <div className="flex flex-col gap-4"> |
| 15 | <h1 className="text-xl font-semibold text-gray-300">Error</h1> |
| 16 | <div className="text-sm text-gray-500">{error?.message}</div> |
| 17 | <div className="flex"> |
| 18 | <Button onClick={() => reset()}>Try Again</Button> |
| 19 | </div> |
| 20 | </div> |
| 21 | </Boundary> |
| 22 | ); |
| 23 | } |
| 24 | |