1

I don't understand why, when I click on browser’s back button my page doesn't reload.

I have a catalog component inside /pages/index.js which is my home page, a dynamic route to navigate to the products /pages/books/[name].js

This is the Link I use to go to the products pages :

<div className="container-cat">
       {products.map((_product) => (
                    <Card id="lien" key={_product.id} alt="book" className="catalogue">
                    <Link href='/books/[name]' as={`/books/${_product.name}`}>
                      <a>
                      <Card.Body>
                      <Card.Img variant="top" src={getStrapiMedia(_product.grid_pic.url)} width="200px" />
                        <Card.Title>{_product.name}<br />{_product.author}<br />{_product.price} €</Card.Title>
                      </Card.Body>
                      </a>
                      </Link>
                    </Card>
               
            ))
          }

      </div>

I don't know what else to put here ...

Rom-888
  • 681
  • 2
  • 9
  • 30

1 Answers1

0

I change my routes, putting the catalog component as the index.js of the /pages/books/

I can't really explain why, but it works

Rom-888
  • 681
  • 2
  • 9
  • 30