1

I've created a simple page to test SSR implementation. There is one thing I couldn't be sure. If you could help to understand would be great!

const EmptyPage = () => {
  console.log("rendered !!!");
  return (
    <Fragment>
      <span>/empty-page-with-next</span>
    </Fragment>
  );
};

export async function getServerSideProps({ query }) {
  return {};
}

export default EmptyPage;

If I open the page, I see that rendered !!! on the server and client(browser's console) both.

I was expecting not to see that on the client.. Is that normal to see it? There is no use-effect, no trigger to re-render the page..?

atasoyh
  • 3,045
  • 6
  • 31
  • 57
  • 3
    This is expected. The render on the server is a *pre-render* to build the initial HTML. It will always render again on the client. – Brian Thompson Mar 18 '22 at 19:05

0 Answers0