Let a rejection declare an http status - #827
Open
pleek91 wants to merge 2 commits into
Open
Conversation
pleek91
force-pushed
the
rejection-status
branch
from
August 29, 2026 22:15
f8a4e32 to
74dbd00
Compare
✅ Deploy Preview for kitbag-router ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
…hing A url matching no route committed the NotFound route and cleared the rejection, so the most common rejection in any app was the one that never set one. onRejection never fired for a 404, useRejection reported null, and the two ways to reach the same NotFound screen left completely different state behind. Set the rejection instead. The rendered output is unchanged: RouterView reaches the same component through the rejection rather than through the route. The route is still seeded with the NotFound route, so useRoute keeps working outside RouterView. That the seeded route is not one of the caller's declared routes remains a separate problem.
A server rendering the app needs to know what to respond with, and the rejection in effect is the thing that knows. Adds an optional status to createRejection, and declares 404 on the built in NotFound rejection. Nothing reads it yet.
pleek91
force-pushed
the
rejection-status
branch
from
September 2, 2026 15:42
74dbd00 to
054e6b2
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
A server rendering the app needs to know what status to respond with, and the rejection in effect is the thing that knows. Adds an optional
statustocreateRejection, and declares 404 on the built inNotFoundrejection.Nothing reads it yet —
router.renderdoes, later in the stack.