Hacker News new | ask | show | jobs
by Mithorium 2887 days ago
Never used next, looks interesting. So with this setup, the browser doesn't do any work, all pages are loaded as if they were static, and rendered server side?
1 comments

Correct!

The way that is achieved is pretty neat, Next.js has a <Document />[1] component that you can extend. This Document is essentially your application shell that is used when server side rendering.

Here is the trends Document component[2] where you can see I'm simply omitting `NextScripts` which ends up being the frontend bundle with react + application code

[1] https://github.com/zeit/next.js#custom-document

[2] https://github.com/hanford/trends/blob/master/pages/_documen...

I'd seen references to next before this but never really dug in deep enough to get a sense of whether it was worthwhile. Thanks for giving it enough context to show how cool and accessible next is.