1

As I don't know anything about React jet, I am wondering, what are the main benefits of introducing React in Angular's directives and what are down sides?

Basically I am working on some complex software with lot's of renderings in one cycle. Obviously I already excluded ngRepeat, etc. but I am wondering if React can speed up rendering in this case even further?

Is react better only in rendering lot's of element's or is it better in rendering of small amount of them as well?

2
  • 1
    It will speedup rendering. Read this article for more details, libraries and comparisons williambrownstreet.net/blog/2014/04/… Commented Jan 14, 2016 at 9:06
  • 1
    React is faster when render in general, so if you implement it into Angular there is no downside to using it for all views (well, except for any implementation time of course). Commented Jan 14, 2016 at 9:23

2 Answers 2

1

That's a subject I've studied at work and here are my conclusions about adopting an hybrid solution (AngularJS 1.x and React) :

Pros :

  • best of both worlds (speed, testability, a lot of convenient things already are implemented in AngularJS — $http, $cookies, whatever)
  • probably forces to uncouple more and more the code. Since the two worlds can't really share components/services, you'll have to adopt a nice architecture which will lilely makes the two parts easy to plug/unplug. Say you wanna use Angular2 components after all, a lot of uncoupling work will already be done.

Cons :

  • You'll have to glue stuff together. The glue code can end being more complicated than expected
  • You'll have to load two frameworks/libs. Although that might not be a problem for SAAS apps, it can very well be for regular websites with a lot of unique visitors.
  • You'll have to learn another framework (should that be in the "Pros" section ?)
  • Maintainance bad smell : the less different technologies, the better
  • An overall more complicated stack

In the end I think that if you don't absolutely need React, try to implement your component in regular JavaScript to avoid excessive $apply cycles. It's cleaner in my opinion.

Sign up to request clarification or add additional context in comments.

Comments

1

You can take a look to this link. This video was recorded last year in the ng-conf and explains how you can speed up your angular application rendering certain elements with react. I think it can help you.

1 Comment

Thanks a lot for your help!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.