Website with dynamic data on vercel as static website. #16472
-
Hi, I have a requirement where I'll be having 7-8 pages as static and blog which can be easily built with NextJs and I have done the tutorial for the same. Along with the static website, there is a dashboard which is user-specific and it contains dynamic data, with user authentication. I'm not able to find any tutorial which can cater to these requirements. I want to use strapi as REST API to display the dashboard. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You can have both static and dynamically rendered pages in the same Next.js project. For pages that are dynamic, you can either use the Note that this decision is on a per-page basis, you can definitely do both on the same project. |
Beta Was this translation helpful? Give feedback.
You can have both static and dynamically rendered pages in the same Next.js project.
For the pages that are static, you have the
getStaticProps
function but you probably already know this as you said that you already have the static generated blog. These will be rendered at build time.For pages that are dynamic, you can either use the
getServerSideProps
if you want to render this page on the server-side or use a normalfetch
in your react component code to contact your API from the front-end.Note that this decision is on a per-page basis, you can definitely do both on the same project.