5

If ReactJS is for the & ldquo; View, what is for the rest of the application...

 2 years ago
source link: https://www.codesd.com/item/if-reactjs-is-for-the-view-what-is-for-the-rest-of-the-application.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

If ReactJS is for the & ldquo; View, what is for the rest of the application?

advertisements

Just beginning to look into ReactJS and I see everywhere that you can think about ReactJS as the "View" portion of the application. OK, so if I'm currently using a framework like AngularJS or Kendo UI or Backbone or whatever and I want to use ReactJS as "the View" instead, does it just work out of the box with these other frameworks?

If not, what are people doing about the rest (routing, templating, etc)? Back to plain JS? jQuery? Adding JS libraries piecemeal to cover the other typical application needs? And what about widgets (grids and things that might be better left to add instead of re-inventing the wheel) - are there widget libraries for ReactJS?

Not being cynical - I really am interested. There's certainly enough buzz out there for ReactJS, but I'm just looking for a complete picture of what building a non-trivial application with ReactJS might look like.


I dislike when people call React the "V in MVC". It's an oversimplification and leads to confusion.

React isn't part of MVC at all. It's a fundamental rethinking of design patterns that replaces MVC. That said, because MVC architecture is the gold standard at present, it comes with the understanding that you're going to need to intermix React with MVC tools.

So perhaps a better way of saying things; In your pre-existing MVC stack, React replaces the V with a new design pattern. And this new design pattern abstracts certain elements that you might traditionally think of as aspects of the M or C in your stack.

So in terms of how to combine React with your other mvc tools? It does "work" out of the box, but where you choose to draw the line between traditional MVC and the React design principles is an architecture decision you need to make.

If you're hoping for more of a "Standard" methodology, though, I would suggest familiarizing yourself with the Flux pattern. There are plenty of implementations of Flux out there, but the basic purpose of the pattern is to handle input/output of data to your React structure. Most guides will explain it in terms of API calls to your server, but you can easily use the same pattern to talk with other frontend frameworks as well.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK