Next.js · Lesson 1 of 5
What Next.js adds to React
Know which problem each feature solves.
React on its own renders in the browser. The server sends a nearly empty page and JavaScript builds the content after it arrives. That is fine for an application behind a login and poor for anything that needs to be found, shared or loaded quickly on a weak connection.
Next.js adds the server side. Four things follow from that, and each solves a specific problem.
Rendering on the server means the visitor receives real HTML. The page appears sooner, search engines see content without executing anything, and a link shared on WhatsApp shows a preview. For a business site or a shop this is most of the reason to use it.
Routing from the file system. A folder becomes a URL. No router configuration to maintain and no chance of it drifting from reality.
An API in the same project. Server routes live beside your pages, so a small application does not need a separate backend, one deployment, one repository.
Images, fonts and scripts handled for you. The image component resizes, converts format and lazy loads. Fonts are self hosted automatically, which removes a third party request and a layout shift.
What it costs: you now run a server, or a platform that runs one for you, and deployment is more involved than copying files to shared hosting. You also have to know which code runs where, which is the main source of confusion for people arriving from plain React.
Learn React properly first. Next.js is React plus a server, and skipping the first half shows.
Take one React page and view its source before JavaScript runs. Then do the same with a Next.js page and compare what a search engine would see.
کوئی ایک React صفحہ لیں اور جاوا اسکرپٹ چلنے سے پہلے اس کا سورس دیکھیں۔ پھر Next.js صفحے کے ساتھ یہی کریں اور دیکھیں سرچ انجن کو کیا نظر آتا ہے۔
Check what you learned
Create your free BvLogic ID to take the quiz and record your score.
Create your BvLogic ID