NextJS vs ReactJS
NextJS is a framework based on ReactJS, NextJS had extended the features of reactjS.
Before going to deep into the concept of NextJS and reactjs, let's discuss the server side and client side rendering.
Client Side Rendering
- In short also called CSR. the web page generated dynamically using javascript inside the browser.
- JavaScript responsive to do that.
- from server we receive only one emapty html file with linked JavaScript file. this linked JS file a responsible to make things dynamic
- All the data that comes on the web page/app, that is dynamically injected throught the JavaScript. mean's there is a separated server who's responsible for client's request.
- All the functions and features implemented throught javascript fetch api. this api fetch data from server and get response.
Server Side Rendering
We all know about html pages, that is sent by the server to the client directly. these html pages are prepared by hosted server.
-
When client request to a server for a particular page, server accept the client request and prepare page for him and after sent the response. so the html page preparation job is done by server itselt.
-
on browser, it only display the html page. and also js provide the interactivity. this js is also provided by the server as par the browser request.
-
NextJS provides server components and other features with it.