How to use React only at server side?

Viewed 196

I decided to give a shot at just using React only for server side rendering of my components written in JSX.

I decided to eliminate React on the client side as there is not much client side interaction and I thought of adding it later only if needed.

I have couple of questions on this approach though:

  • How to use plain simple vanilla JavaScript at the client side? I'm still using JSX for my components. Any simple example, like handling a button click via event listener?

  • Bringing the entire hot module replacement experience with this approach. Right now i am using webpack --watch and then restarting node server on any files changes as also stated in this comment. Also, where it's just pure SSR, how to refresh the screen? Right now I don't have to restart my server, but I have to still refresh my screen to reflect my changes.

Has anyone been successfully able to use webpack-hot-middleware in this approach, where it's just pure SSR?

0 Answers
Related