Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does React.js require server side?

Tags:

reactjs

All React.js introductions seem to suggest that React uses a server to create virtual DOMs and sends diff operations over to client, but I just tried out the flux-todomvc which it didn't need a server at all. What's going on? Is the "server side" work done inside web worker thread?

like image 414
frank Avatar asked Nov 02 '14 04:11

frank


People also ask

Does ReactJS need a server?

You don't necessarily need a static server in order to run a Create React App project in production. It also works well when integrated into an existing server side app.

Does React run server side?

Yes! This is where server-side rendering for React comes in. In this article, I want to introduce you to server-side rending (SSR) with React, reasons to use it, and some popular frameworks for rendering React on the server side.

Do I need backend for React JS?

js or Gatsby, you don't need a backend. Instead, you could simply write your blog posts as markdown files, which are stored and tracked (using Git) within a project folder.

Is React a server side scripting language?

Think of ReactJS as a server-side templating engine here (like jade, handlebars, etc...). The HTML rendered by the server contains the UI as it should be and you do not wait for any scripts to load. Your page can be indexed by a search engine (if one does not execute any javascript).


1 Answers

React.js does not use a web server to create virtual DOMs. It builds the virtual DOM and does its diff operations on the client's browser.

  • People mostly use React.js to implement front-end Views (MVC View) of their web applications.
  • But you can use Node.js to render them on the server side if you like (for seo purposes etc.)

  • http://facebook.github.io/react/

like image 184
nilgun Avatar answered Oct 13 '22 13:10

nilgun