Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

i know what angular.js is and i even had a question about it @AngularJs & Laravel.

but recently i started to read about React.js and from its site (its the V in the MVC) which is exactly what am after "handling the view and nothing else".

for me i think Angular.js as an MVC framework was made to be used with something that is built with JavaScript from start to end like Node.js

and it seems like an overkill when used with something like Larval, where i simply need something to handle the frontend and nothing else + Angular have 2 main drawbacks

  • with the latest news about a new version that wont have a back compatibility with the current version makes me even feared to start learning it just to find that more or less every project out there is using the old version which mostly is true.

  • angular renders the whole dom if anything got changed which again is an issue for big projects.

so based on the above ,plz note that i want to learn/use JS solely to enhance the user experience not to build another Gmail or Facebook and so my question is ,

could React.js be used with Laravel to handle the view and do everything Angular was going to give, or i have to use Angular liked or not ?

share|improve this question
1  
What facebook means by saying it doesn't handle the M and C is that it doesn't worry about fetching data from the backend,whether its rest or something else. Doesn't handle data binding. Angular does support this. So if you have a REST api, you can tell angular and voila it will take care of GET, PUT and Delete requests. You are still free to use angular just for the views –  Somesh Mukherjee Dec 21 '14 at 7:05
1  
I feel like this is a matter of opinion. The boiled-down truth is that you can just about always make whatever work with whatever else, it's just a matter of how much work that may or may not entail. I've seen and done plenty of strange combinations of technologies simply because it was what I had to work with. –  Jhecht Dec 21 '14 at 7:07
    
I've been using it with ASP.NET MVC for quite some time now I'm loving it. –  Dimitar Dimitrov Dec 21 '14 at 7:34

1 Answer 1

up vote 2 down vote accepted

could React.js be used with Laravel to handle the view and do everything Angular was going to give?

No

React is just for views. React components are stateful components with some really clever rendering stuff happening behind the scenes. To build a fully functional front-end app, you'd need to tie in some other code (or write it yourself).

React works well with Facebook's Flux architecture. I would suggest looking into that to learn how to manage the state of your react components.

What's key to understand here is that Flux and React are not parts of a large front-end framework. React is a library and Flux (as provided by Facebook) only provides a Dispatcher. The rest is up to you to implement. There are some pre-existing implementations you can look at if you need some help to get started.

What I like about flux is that it let's me implement things the way that fits my application best. React takes care of the heavy DOM lifting and is very easy to learn. Compared to Angular, I don't have to learn arbitrary conventions and gigantic APIs of a huge framework.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.