How to use static pages with data fetching?

Also, we are trying to get our NextJS codebase to actually use the static pages it’s generating, but with this highlighted recommended route, it just uses our CMS for data fetching, which is slow for us

Unless we are confused… Does the recommended way use the static data in components/plasmic folder and the data in .next/server/pages

Hi @scientific_porpoise, I’m not sure I follow the question.

To clarify, if you use usePlasmicQuery + some CMS + getStaticProps/getServerSideProps, everything should be fetched statically.

What are you seeing?

I think we are confused that it wasn’t using the static generated data. Also, we are confused on the components/plasmic folder and the data in .next/server/pages

getStaticProps will automatically build static pages and serve those. So contacting the CMS should only be at build time

Do you have a concrete example that could help me understand the issue?

The recommended way does not have to do specifically with components/plasmic (that’s specific to codegen)

hi @yang Let me get something together for you and your team. Thanks!

@yang Is there a way we can use Code Components with getStaticProps/getServerSideProps?

We’re currently overriding componentProps of our Code Component in our dynamic pages. DMing you more details