NextJs

December 12, 2020

To scaffold a NextJs app, Type:

npx create-next-app

or

Manual setup, Type:

Install next, react and react-dom

in your project folder:

Open package.json and add the following scripts:

"scripts": {
  "dev": "next dev",
  "build": "next build",
  "start": "next start"
}

Create a pages directory inside your project.

Populate ./pages/index.js with the following contents:

function HomePage() {
  return <div>Welcome to Next.js!</div>
}

export default HomePage

To start developing your application type npm run dev

Visit http://localhost:3000 to view your application.

source: https://nextjs.org/


Disclaimer: All views expressed on this blog are solely my own, and do not represent the opinions of any entity i am affiliated with.
© 2021, Built with