Why would I want to render React.js components on the server?

Rendering #ReactJS on the Server has a few benefits 🌟👉  #JavaScript #WebDev #Programming

  • 1) If you combine server side caching with server side rendering, basically you are reducing render time on all client pages, just by rendering it once on the server.
  • Both server side rendering and client side rendering have pros and cons.
  • I’ve got the Youtube video that answers your question!
  • Receive notifications when there are new responses to this question .
  • 2) when you want your app to have a quick initial load (since you don’t need to front-load everything in your js bundle).

Why would I want to render React.js components on the server?. Tagged with ReactJS.

@hashnode: Rendering #ReactJS on the Server has a few benefits 🌟👉 #JavaScript #WebDev #Programming

Both server side rendering and client side rendering have pros and cons. Short answer: you might want to render React.js components on the server:

1) when you care about the SEO (when search engines crawl your site, you want them to see pre-rendered content instead of an empty

2) when you want your app to have a quick initial load (since you don’t need to front-load everything in your js bundle).

Expanding upon @nova’s 2nd point … when you want to support browsers with JavaScript disabled.

Ahh haha. I’ve got the Youtube video that answers your question!

It’s from Google I/O 2016 with Addy Osmani as the presenter.

The gist of the presentation is that he talks about building progressive apps across using three different libraries/frameworks including React.

Bottom line is that there are some pretty awesome performance gains to be had if you build your app correctly with server-side rendering.

There’s also the whole SEO thing.

1) If you combine server side caching with server side rendering, basically you are reducing render time on all client pages, just by rendering it once on the server.

2) If you have some business logic on the front end, and you want the user to have access to the rendered view instead of knowing how the logic works.

Why would I want to render React.js components on the server?