Skip to content
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

docs(guide): Clarify how to handle 404s #3798

Merged
merged 1 commit into from
Jul 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions contributors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,7 @@
- rphlmr
- rtabulov
- ruisaraiva19
- runmoore
- Runner-dev
- rvlewerissa
- ryanflorence
Expand Down
3 changes: 2 additions & 1 deletion docs/guides/not-found.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ There are two primary cases where a Remix site should send a 404:
- The URL doesn't match any routes in the app
- Your loader didn't find any data

The first case is already handled by Remix, you don't have to do anything. It knows your routes so it knows if nothing matched. The second case is up to you, but it's really easy.
The first case is already handled by Remix, you don't have to throw a response yourself. It knows your routes so it knows if nothing matched (_consider using a [Splat Route][splat-route] to handle this case_). The second case is up to you, but it's really easy.

## How to Send a 404

Expand Down Expand Up @@ -117,3 +117,4 @@ As you can probably tell, this mechanism isn't just limited to 404s. You can thr
[catch-boundary]: ../api/conventions#catchboundary
[errors]: errors
[404-status-code]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/404
[splat-route]: ./routing#splats