If you want the comments to be updated each time the page loads you need to use getServerSideProps. If you are wanting fast pages use getStaticProps and re-fetch the data once the page has loaded - check out swr.vercel.app/ which is a React hook that can help with this.
Tks bro, i still using swr to fecth data from api.But i think post list should use getStaticProps togenerated at build time and will be reused on each request.
If you want the comments to be updated each time the page loads you need to use
getServerSideProps
. If you are wanting fast pages usegetStaticProps
and re-fetch the data once the page has loaded - check out swr.vercel.app/ which is a React hook that can help with this.Tks bro, i still using swr to fecth data from api.But i think post list should use getStaticProps togenerated at build time and will be reused on each request.
Yeah that sounds sensible.