ReactJS and routes

2

The ReactJS framework comes with the idea of web components.

Well, it does not use MVC

But what about routes? on a menu? how would I access my components correctly?

    
asked by anonymous 21.07.2014 / 22:12

1 answer

4

Within an MVC framework, React.js would be the "V" of the architecture. In other words, it is only and only the view.

If you access the official website , there is an excerpt intended for this:

  

JUST THE UI

     

Lots of people use React as the V in MVC. Since React makes no assumptions about the rest of your technology stack, it's easy to try out on a small feature in an existing project.

Free translation:

  

JUST ON UI

     

Many people use React as the V of MVC. Since React has no responsibility for the rest of its technology environment, it is easy to use it in a small mechanism of an existing project.

In other words, any type of logic is outside the scope of React.

But there, how to solve your problem? React is seamlessly integrated with an MVC framework / framework, such as Backbone.js . If you want some reference, see:

Update

Talking to @Rodrigo in the comments below, I realized that time has slightly depreciated the link above, which only works , but is by far the best reference - even if you notice, this does not was my bibliographic proposal, the idea is:

  

[...] If you want some reference, see: [...]

However, since my architecture is always Backbone-based, I created a blog post some time ago that explains how to inject controllers to handle the dialog layer between models and efficiently . If it's of interest, here is the link .

    
21.07.2014 / 22:25