1 | initial version |
No, it is not mandatory for all pages to be CSR (Client-Side Rendered) when using the new app directory in NextJS 13 with MUI (Material-UI). The new app directory allows for more flexibility in choosing the rendering strategy for each page.
By default, NextJS 13 with MUI uses SSG (Static Site Generation) for pages that don't need dynamic data, and CSR for pages that do. But you can explicitly choose the rendering strategy for each page by setting the getInitialProps
function in the page component or using the getServerSideProps
function.
For example, you can use getServerSideProps
to fetch data for a specific page on the server, which will result in server-side rendering. Or, you can use getStaticProps
to pre-render a page at build-time, which will result in static site generation.