0

I have a simple page on which I'd like to call getStaticProps :

const TagPage = (props) => {
  console.log(props);
  return <h1>hi</h1>;
};

export async function getStaticProps() {
  return {
    props: {
      hi: "hi",
    },
  };
}

export default TagPage;

But I only get params: { tag: 'quotidien' }, searchParams: {} } from the console.log My file is under app/site/tag/[tag]/page.tsx Can someone explain me why it isn't working ?

1 Answers1

0

just read that you can't use getStaticProps in app folder. Link : https://nextjs.org/docs/advanced-features/custom-app

  • 1
    The new app dir added better server-side fetching with normal async functions. Check it out here: https://beta.nextjs.org/docs/data-fetching/fetching – rguarascia.ts Apr 11 '23 at 00:51