Sunday, 9 April 2017

Understanding how ReactJS and NodeJS app can work

I'm trying to learn React JS, but I have difficulties understanding how it should work with NodeJS, let's say with Express.

So far I understand that ReactJS is "V" in "MVC" This is easy, I can already write a code using create-react-app

This is how I understand that:

  1. "natural" way of combining React and Express is to simply write frontend in React and api in Express (with Mongo for example). This way we can simply make ajax calls from React to our /api and show data

  2. there is also a possibility to use React to server side rendering, which requires little more configuration. This way we do not call /api from React, we just use React to write code which can be rendered by Express

My question is Am I thinking right ? Not sure about all that... Is Isomorphic JavaScript somehow related to #2 ?



via M.D

No comments:

Post a Comment