-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
fix: update error handling in MatchInner to access error data directly #4746
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
leesb971204
wants to merge
9
commits into
TanStack:main
Choose a base branch
from
leesb971204:fix/nested-notFound-data
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+169
−8
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
f907711
fix(router): spread data props in notFoundComponent
leesb971204 a3bdffd
refactor(router-core): change proper NotFoundRouteProps type definition
leesb971204 35ec117
test(react-router): add test verify notFoundRouteProps properly passe…
leesb971204 0b6cccb
docs(react-router): correct type annotation for data in notFoundCompo…
leesb971204 2e28b59
refactor(router-core): enhance NotFoundRouteProps type with generics …
leesb971204 3f98c67
refactor(router-core): simplify NotFoundRouteProps type by removing g…
leesb971204 337c168
test(react-router): improve notFoundComponent tests with type guard f…
leesb971204 0fc4886
docs(router): revert type annotation for data in notFoundComponent
leesb971204 17e1384
docs(router): add NotFoundComponent documentation and update router A…
leesb971204 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
36 changes: 36 additions & 0 deletions
36
docs/router/framework/react/api/router/notFoundComponentComponent.md
This file contains hidden or 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,36 @@ | ||
--- | ||
id: notFoundComponentComponent | ||
title: NotFoundComponent component | ||
--- | ||
|
||
The `NotFoundComponent` component is a component that renders when a not-found error occurs in a route. | ||
|
||
## NotFoundComponent props | ||
|
||
The `NotFoundComponent` component accepts the following props: | ||
|
||
### `props.data` prop | ||
|
||
- Type: `unknown` | ||
- Optional | ||
- Custom data that is passed to the `notFoundComponent` when the not-found error is handled | ||
- This data comes from the `data` property of the `NotFoundError` object | ||
|
||
### `props.isNotFound` prop | ||
|
||
- Type: `boolean` | ||
- Required | ||
- A boolean value indicating whether the current state is a not-found error state | ||
- This value is always `true` | ||
|
||
### `props.routeId` prop | ||
|
||
- Type: `RouteIds<RegisteredRouter['routeTree']>` | ||
- Required | ||
- The ID of the route that is attempting to handle the not-found error | ||
- Must be one of the valid route IDs from the router's route tree | ||
|
||
## NotFoundComponent returns | ||
|
||
- Returns appropriate UI for not-found error situations | ||
- Typically includes a "page not found" message along with links to go home or navigate to previous pages |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part causes the structure to become nested like
data: { data: ... }
.