docs: type error.js error prop as unknown (#100232)
## Summary
Follow-up to #100196. `error.js` and `global-error.js` receive whatever
was thrown: Server Component errors arrive as an `Error`, but a value
thrown in a Client Component is passed through as-is. The docs annotated
the prop as `Error & { digest?: string }` and described it as always an
`Error`.
- `error.mdx` and Getting Started > Error Handling: type `error` as
`unknown` in the `error.tsx` and `global-error.tsx` examples, and
describe the prop as the thrown value, with a note to narrow before
reading `message` or `digest`.
- `with-stripe-typescript`: the three `error.tsx` boundaries narrow with
`instanceof Error`. The component is renamed from `Error` to `ErrorPage`
so it no longer shadows the global.
<!-- NEXT_JS_LLM -->
Showing
Please
register
or
sign in
to comment