0

I have a category list, which changes the address of the page by selecting each category, similar to dynamic adress, for example, when you select a game, the address goes to: /s/game changes Or you choose real estate /s/estate

To transfer from the code:

router.push(address), null, {
      shallow: true,
      scroll: false
    })

I use.

But the problem is that the things related to receiving the link only work the first time and the second time only the address changes and getStaticPaths and getStaticProps do not work at all!

The codes inside related to the /s/[category].js file (address recipient file):

export async function getStaticPaths() {
  return {
    paths: [
      { params: { category: "Search Category" } },
    ],
    fallback: false,
  };
}

export async function getStaticProps(context) {
  const { params } = context;
  return {
    props: {
      category: params.category,
    },
  };
}

It means that after compiling the component, the related items will no longer work!

where is the problem from ? Do you know the best method for this? Thank you for telling me

I have said all the things I used in the question

m. saebi
  • 1
  • 1

1 Answers1

0

You may try to troubleshoot this issue with hlep of developer tools integrated with your browser Firefox or Chrome then in network tab look at http requests. You are looking for new http get to new uri

Thierry Brémard
  • 625
  • 1
  • 5
  • 14