Home>

I'm studying Next.js with a file structure like the one shown in the photo, but I created a static folder to display the images and put the images I want to display in it.

When I try to display this with the following code, it is not displayed. I would like you to point out the mistakes.

import Link from "next/link";
import Layout from "../components/Layout"
import Image from "../static/Image";
export default () =>(
  <Layout header = "Next" title = "Top page.">
  <p>Welcome to next.js!</P>
    {/ * This part * /}
    
    {/ * * /}
  <hr/>
  <Link href = "./ other">
      <button>go to Other&gt;&gt;</button>
  </Link>
  </Layout>
);
  • Answer # 1

    How about writing with a relative path?

  • Answer # 2

    Files other than pages./public/Please put it under the folder.

    ..
    ├── components
    │ └──<React component ...>
    ├── package.json
    ├── pages
    │ └──<Page written in React ...>
    └── public
       └──<Static file ...>