Andrei Duca
1 min readAug 31, 2018

--

Short answer: no, you can’t have SSR and hot-reloading on the client React app at the same time. But nor should you need it.

To elaborate a bit:

When developing the client app, that’s what you’re doing: you’re just developing your client app. You don’t need to run the server with SSR. You can use the create-react-app start command and run just the client. This way, you get fast development process with hot-reloading and all.

SSR should be your final step, and implemented and tested separately, and it’s mainly used for the production environment. When developing the server part of the app, you can use nodemon as you mentioned. But this has nothing to do with your React client app.

That being said, the way SSR works (following my article) is this:

  1. the server app renders the client React app intro a string;
  2. it injects this string into the html from the build directory;
  3. this html file will request the build version of client React app, which is bundled and production-ready, lacking any dev-related stuff, including hot-reloading;
  4. once the javascript file is downloaded and parsed, it will hydrate the injected html and fire the client app.

So even if you would want to achieve what you ask, this would not be possible technically.

Hope this answered your questions and cleared some things up.

--

--