Re:Remix Vite Is Now Stable
by robertoandred on Wednesday February 21, 2024 @12:24PM
(#39456683)
Next's headers function is an elegant layer over the Web Headers API.
But I want the request. Remix points the reader to the MDN docs. Next invents its own little thing. This is the fundamental difference in philosophy.
Re:Remix Vite Is Now Stable
by robertoandred on Wednesday February 21, 2024 @05:12PM
(#39460372)
The Web Headers API isn't Next's own thing. They point you to the MDN docs.
And if you want a route's request object in Next, use a route.js file.
> This is a Fetch Request instance. You can read the MDN docs to see all of its properties.
Compare this to Next's app router equivalent of fetching the request headers [1]:
> The headers function allows you to read the HTTP incoming request headers from a Server Component.
[0] - https://remix.run/docs/en/main/route/loader#request
[1] - https://nextjs.org/docs/app/api-reference/functions/headers