What's the point of using react?

I know that react allows you to render things to the DOM and stuff, but here is what freecodecamp says that confuses me:

React involves Composition that is lots of components wrapping up the functionalities into an encapsulated container. Many popular websites use React implementing the MVC architectural pattern…

…How these large applications are build using React? The simple answer is by building small applications or components.
*

the bold text is the highlighted stuff I don’t understand. Why build small applications in your site when you can link them to different small sites?

for example:

would this be easier?
[Master]->[small application linked somewhere else]
|
v
[small app linked somewhere else]

or would this be?
[Master > {small app encoded inside master site}
v
{small app inside of site}]

React isn’t MVC. And

This is generally called a microservices architecture and it is very difficult to manage. You could build all the individual parts of your application as separate applications, but you then need to join those all together, and that’s difficult in practice.

I think you’re misunderstanding what they’re saying – it’s not super clear but would it make more sense if the quote was more like

3 Likes

I’ll try use facebook as an example. You don’t need to go to a seperate link to see messenger. They’ve built a smaller messenger Component, that they can easily put on every page of their site.

3 Likes

Oh, so that’s why you can stay on a page and have a small messenger app built into it. I’ve never noticed that.

I think @M-Michelini is right. With the micro front-end architecture it is becoming more common to write the FB Messenger as a separate application and inject it inside a Facebook page.

You could have a shell (Website and domain) where you can inject all your little React/Vue.JS/any other framework Applications

1 Like

6 words

reusability (component-based design)
reactivity (instant feedback)
performance (change detection and shadow dom)
declarative and functional
data-flow

1 Like

I think you’re confusing front-end and back-end here. Microservices would be a backend architecture. React is a front-end thing for writing webapps, and it excels at being a client for such microservice (actually the trendy term now is “serverless”) applications, since it can, well, react to changes in app state that are triggered by API calls to the backend. Combine with redux for an elegant way of managing that state, then you start looking into sagas and now you have the front and back ends cooperating on data integrity. The React ecosystem of plugins and extensions is incredible. There’s a reason Facebook does its entire front-end with it.

2 Likes