react-router
react-router copied to clipboard
docs: correct Error Boundary documentation and use useRouteError hook…
Closes #14433
Description of the Change
This Pull Request addresses the documentation issues raised in issue #14433 concerning the Error Boundary documentation.
The key changes implemented are:
- Correction of API: Removed the outdated and incorrect reference to the non-existent
Route.ErrorBoundaryPropsprop type in theErrorBoundarycomponent signature. - Hook Adoption: Updated the example code to correctly demonstrate the use of the
useRouteError()hook, which is the official method for accessing error data or response statuses within an error boundary component.
These changes ensure the documentation accurately reflects the current React Router API, significantly improving developer experience.
⚠️ No Changeset found
Latest commit: e35e1f2982ad8e334a71abb2ef8fb6241c23e15f
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
This PR includes no changesets
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
Hi @lizandrapinheiro,
Welcome, and thank you for contributing to React Router!
Before we consider your pull request, we ask that you sign our Contributor License Agreement (CLA). We require this only once.
You may review the CLA and sign it by adding your name to contributors.yml.
Once the CLA is signed, the CLA Signed label will be added to the pull request.
If you have already signed the CLA and received this response in error, or if you have any questions, please contact us at [email protected].
Thanks!
- The Remix team
Thank you for signing the Contributor License Agreement. Let's get this merged! 🥳
Unfortunately, the change needs a bit more nuance that this. This change alone incorrect for Framework Mode users. I made some updates in 0262b1b32 to address #14443.
Thanks for putting up this PR, however
ErrorBoundarycomponent's do receive anerrorprop, andRoute.ErrorBoundaryPropsis the correct typeuseRouteErroris not "the official method for accessing error data or response statuses within an error boundary component", it's just one way to access it
See this comment for more details: https://github.com/remix-run/react-router/issues/14433#issuecomment-3503183091. I would be open to adding an example that shows how to use useRouteError, but we don't want to change the existing example.