brayniverse's avatar

Thoughts on React.js

Hey everybody, hope you're having a lovely day.

I want to pick a few brains today to see if anybody has experience using React.js? I just ran through the examples they have on their site and watched a couple of presentations (primarily from core contributors) and it sounds promising, but I'm wondering how it performs in real world projects - I know facebook actively use it but my personal experience with facebook's developer projects hasn't always been positive.

Has anybody used React.js on a project, if so could you answer any of the questions below or give me some of your thoughts.

  1. How does React.js compare to other frameworks such as Angular.js and Ember.js?
  2. Are there any conventions I should be aware of that are noteworthy?
  3. Can you provide me with any resources you found useful on the subject?

Thank you in advance :)

0 likes
7 replies
4jZW7jVSdS4U6PC's avatar

I'm not a font-end developer but I've around me a few of them and they discussed about React.js few weeks ago.

As far as I know you cannot compare AngularJs with ReactJs because they are two different things but you can compare Angular Directives with React which is the closest vs you will never do with those frameworks.

Quora user said what I've just written about this comparison, also he wrote about the difference between Angular and React in terms of coding and learning.

Recent Blog post Another comparison of course but it's more updated.

nolros's avatar

I use Angular but I've also used React. React is much more intuitive but not as rich as Angular. Angular is really like using another Laravel in that it is a very comprehensive MVC JS framework whereas React really only focuses on the V. Angular has modules for everything, resources, routes, animation, etc. and is highly customizable all the way to building your own DOM elements. It has a very rich front-end developer suite with tons of conditional logic ng-if, ng-repeat, in fact there is a ng- for just about anything you want to do. Angular has a steep learning curce, but once you get the hang of it it is a great framework. React much easier early on but as you get deeper it gets more complex. React uses JSX so coudl write an entire REact app using jsx and some react developers end up moving to jsx. I have no intentions of swapping React for Angular but then again React is still growing. Personally I think alot will change this year with the new JS ES6 so I suspect the JS landscape will change in the next year or so.

Example of the React app.js file

var React = require('react');
var Catalog = require('./catalog/app-catalog.js');
var Cart = require('./cart/app-cart.js');
var Router = require('react-router-component');
var CatalogDetail = require('./product/app-catalogdetail.js');
var Template = require('./app-template.js');

var Locations = Router.Locations;
var Location = Router.Location;

var APP =
  React.createClass({
    render:function(){
      return (
        <Template>
          <Locations>
            <Location path="/" handler={Catalog} />
            <Location path="/cart" handler={Cart} />
            <Location path="/item/:item" handler={CatalogDetail} />
          </Locations>
        </Template>

        )
    }
  });
module.exports = APP;
tjm's avatar

React is the best. Your layout (view) and your application state (say if something is toggled or not) never gets out of sync. It's sync. Things just make sense.

I wrote a quick blogpost that might be helpful for my company's blog.

2 likes
nolros's avatar

@tommymarshall the problem with ReactJS is sooner later as a serious JS developer you will just start writing in JSX, which is terse. A lot Angular developers moved across and have now moved back. That said, it is a good and fun way to write JS.

tjm's avatar

@nolros I don't know if I would call JSX terse. It's different and at first glance seems appalling. But after working with it a day, you realize it's just HTML in JS. And super cool.

Please or to participate in this conversation.