Hacker News new | ask | show | jobs
by johnsberd 4019 days ago
Are people always using React with another framework or can you build out full applications with just React? Im looking to start another project and want to try React but not sure if it has everything I'm looking for.
5 comments

React + Flux in the form of Flummox (along with react-router for routing) is enough for a 10kloc application I recently wrote for Expedia. If you don't want to make architectural decisions or composing smaller libraries then I think Ember is a better choice, but for us React is perfect.
You don't need another framework to build apps with React. But you will need several libraries as React isn't "kitchen sink" type framework like Ember and Angular.

In my React-based apps, I typically include react-router for routing and request or superagent for ajax calls. You can also include a Flux-inspired library if you're into that sort of thing.

The only thing you need is Ajax and you have it right here in the browser without the need of a third party library. All the rest can be handled by React and its plugins.

That's how I do things, React + raw Xml Http requests. Since JSX is already a layer on its own no need to add yet another layer of complexity.

React is the "View", so you need something like Backbone to fuel it. Roll your own, use Backbone, Flux (made by FB especially for React) or Reflux (third party. Flux re-imagined).
I would advise against using Backbone with React/Flux. First, because you don't need it, and secondly, because Backbone is mutable by default, which can cause all sorts of data flow bugs.

Once you buy into the Flux methodology (not necessarily Flux as described by Facebook), a lot of the concerns that Backbone handles melt away. You don't need observable collections and models because all state changes are explicit and data moves in just one direction. Given that Backbone's core is just a thin layer on top of XMLHTTPRequest, you're better off just doing XHR yourself, with POD objects for data.

Just pure react is great for tiny things, but for large applications you should use React with Flux architecture with alt or flummox or reflux or whatever you like, it simplifies things in the long run.

Of course you would need to do things like ajax or routing, for which there are endless libraries, or you can just go pure XHR. React-Router is terrific for routing.