This content originally appeared on DEV Community and was authored by FatimaAlam1234
Important Properties in context of getServerSideProps
Params -> for dynamic parameters.
request -> to view the request from the client.
response -> to set the response for the client.
query -> to get hold of the query parameter hit in the url.
What happens at build time?
- There is a lambda-symbol against the pages which are server-side-rendered.
- This symbol states that this page renders at run-time.
- Also there are no json or html files formed in the app during build.
- Even after the 1st request the above files are not generated because SSR is basically dependent on run-time requests.
- Also the problem of stale data is solved as when we refresh the application, the latest data is fetched without the need for a validate key.
This content originally appeared on DEV Community and was authored by FatimaAlam1234
FatimaAlam1234 | Sciencx (2024-06-22T13:17:59+00:00) NextJS – getServerSideProps. Retrieved from https://www.scien.cx/2024/06/22/nextjs-getserversideprops/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.