Payload Logo
Computer Science

Looking into Next.js

Author

Bijun Jiang

Date Published

computer science image

For the longest time, I’ve been developing with React on the front end and Express.js as the backend.
Recently, I finally got the chance to dive into Next.js — and honestly, I’m loving it.

If you’ve worked with React before, you know it’s great for building UIs — but setting up everything around it (routing, data fetching, etc.) often feels like a separate project of its own.
Next.js takes care of all of that. It configures the environment and also supports both server and client components, allowing developers to choose where things happen — on the server or in the browser.

By moving rendering and data fetching to the server, end users receive less JavaScript, faster load times, and better overall performance. But it’s not just about speed — it’s also about the flexibility.
Tasks like fetching data from a database feel much more natural and efficient when done on the server side. (Honestly, I never liked fetching data inside a useEffect hook anyway.)

Meanwhile, UI updates and interactions can stay client-side. Simply by adding a 'use client' directive at the top of the file, I can create the good old JSX/TSX React client components that I'm already comfortable with.

computer science image
Computer Science

I'll start with a basic definition: React is a JavaScript library for building interactive user interfaces (UI), mainly used in web development.