Problem is as I my self found out few days ago using Next.js that React application is not mounted. What that means is that Server Side Rendering is exactly that. React app is 'rendered' aka static HTML file is created on the server, and served to the browser. But in that process React is not mounted and no hooks are fired. Maybe componentWillMount I am not sure and have not tested.


I think the only lifecycle hook that will be called server side is componentWillMount as explained here

Even then you would not see output on Chrome's console. You are only likely to see it in your node logs.

Let me know if this answers your question.

Related Query

More Query from same tag