skip to Main Content

I’m new with NextJS. When I try to research NextJS. I have a question "Why do we need to use NextJS?". As I know NextJS is used for rendering pages from the server and it is based on ReactJS. But ReactJS is used to develop with the Client Side Render approach and it is difficult to SEO. Therefore, NextJS has been created to help with SEO. But when we use NextJS to render from the server side, why don’t we use other frameworks such as Django, Zend, Flask, … And NextJS render pages from the server, it is different from the ReactJS approach (render from the client site, it help to reduce server load).

Please help me to answer this question, thanks!

2

Answers


  1. NextJS is able to rehydrate the SPA Single Page Application, you can still build an SPA, where only the first entry point is rendered on the server, as the user interacts with your application all the rendering is done in the browser, as in any other react app.

    Statically generated pages are still reactive: Next.js will hydrate your application client-side to give it full interactivity.

    Source

    This way you can build an SPA which can be read by crawlers without javascript.

    Login or Signup to reply.
  2. Before we start, it’s always better to see a framework’s official feature list.

    Automatic Pages,
    Data Fetching,
    Built-in CSS Support,
    Layouts,
    Image Optimization,
    Font Optimization,
    Static File Serving,
    Fast Refresh,
    ESLint,
    TypeScript,
    Environment Variables,
    Supported Browsers and Features,
    Handling Scripts

    But in general what I can say is, React doesn’t have a strict or a fixed way of doing stuff, nor a project structure. In NextJS you can have it easily.

    Also, all the features NextJS provides we can do in a manual way. But why shouldn’t we also use a framework that’s giving all I want as an option in the best-engineered way?

    Please traverse this link. Hope reading this will also make you a fan of NextJS.

    NextJS Doc

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search