Hello everyone!
I like reach router much better than react router dom. After reading the documentation and searching for issues I could not find a way to return http error code 404 from the "default" route.
It is a very important feature to have and should be documented in the SSR section.
Thank you
Not just SSR, I'm interested on client as well. Thanks!
Same here for client rendering, it's so essential feature.
There is info in the tutorial on this on the official router page. Am on mobile, so difficult to search but go over initial few examples and it鈥檚 there.
@ryanflorence is that possible?
As mentioned, it's been added in the docs 馃帀
As mentioned, it's been added in the docs
It not send 404 status code. Browser receives 200 OK.
As mentioned, it's been added in the docs
It not send 404 status code. Browser receives 200 OK.
I can confirm, the browser receives a '200 OK' response. @mtliendo, it's true the docs state:
When no children match, a route component with a default prop will render. Think of this like a 404 on the server.
This method works exactly as far as having a default page when a route is not found, however, I feel, IMHO, that for a _true_ 404 error, the browser should be receiving a 404 status code as well... Perhaps this comes down to React application philosophy?
Most helpful comment
Not just SSR, I'm interested on client as well. Thanks!