concept react in category nextjs

appears as: React
Next.js in Action

This is an excerpt from Manning's book Next.js in Action.

React is a library for building user interfaces. This means that you have the freedom to choose how to implement whatever it is that you’re building, using any combination of React or other JavaScript packages that suit your needs. By contrast, web frameworks have already made a lot of decisions for you. It might be easier in the beginning to build your application using a framework, but once you discover cases where you need flexibility that the framework doesn’t offer, it’s too late.

Listing 3.1: The template used for each page when adding initial content.
import React, { Fragment } from "react";
import Link from "next/link";
 
export default function MyPage() {
  return (
    <Fragment>
      <div className="container">
        <header>
          <nav>
            <h1>Page Title</h1>
            <ul>
              <li>
                <Link href="/messages">
                  <a>Messages</a>
                </Link>
              </li>
              <li>
                <Link href="/friends">
                  <a>Friends</a>
                </Link>
              </li>
            </ul>
          </nav>
        </header>
        <main>
          ...
        </main>
      </div>
      <style jsx global>{`
        ...
      `}</style>
    </Fragment>
  );
}