
Why people use Next.js a lot
Client-side rendering creates HTML
in real time in the browser, and
server-side rendering creates HTML
on the server in advance and sends it to you.
Using client-side rendering can create a beautiful and smooth site, but it also has the disadvantages of
but there are disadvantages such as slow loading speed of the first page and difficulty in search exposure.
The bounce rate of the website is lowered, and it costs a lot of money to advertise to get traffic.
So, the return on investment metric will be low.
When using server-side rendering
The above disadvantages often disappear because the HTML
is pre-created on the server.
This is why there are so many places that use client-side rendering and then switch back to server-side rendering.
However, if you choose to use server-side rendering
useState
useEffect react-query redux ajax react-router props
, etc.
You don’t need much of what we used to call frontend specialization.
This version (v12) of Next.js
is packed with fun, useful features + better performance.
- Folder-based autorouting
- Redesigned server API functionality
- Easy
DB
connections - Intuitive rendering strategy selection
- Server-side rendering without JavaScript delivery
- Powerful caching
- Image and font optimizations
and more.
Membership authentication is also easy to implement with libraries like Next-auth.
There are actually a lot of what we call “rendering frameworks,” including nuxt
, sveltekit
, and remix
.
There are a lot of options, but the newer rendering frameworks like Next.js
They all have a similar syntax, so it’s easy to learn one and then the others.
Of course, there are downsides.
- The
React
library’s newspaper client component and server component are introduced to code.
It’s very annoying to write code separately.
- I don’t use it much, but if you need to use features like
WebSocket
andWebRTC
, it’s better to make anotherNodejs
+express
server by yourself - And because it’s unfinished and released version 13, there are still many unstable updates. Every time I update, something breaks.