Create new pages in Next.js

Let's try to create some pages in next.js

Step 1

Create a new file about.js in the pages directory and hit enter.

Step 2

Since next.js is a react framework, most of the time you will use react code. So our about.js page is going to be a react component. So open your about.js file and write this code:

function AboutPage(){
    return <h1>About Page</h1>
}
export default AboutPage;

Step 3

Save this file and go to this http://localhost:3000/about link, and here your brand new page should appear.

3

1