Honest noob question, what's with all the hype about React? Edit: Awesome replies, thank you!
No one mentioned code sharing between server side and the client side! (There are other ways to achieve this other frameworks/libraries are catching up) If you have a node.js server you can use react for both server side rendering and client side rendering.. So that you get the SS rendering advantages like fast initial page load and SEO but also have a very dynamic web app after the initial render.
Free React.js Fundamentals Course
31–40 of 117 posts
Re: Free React.js Fundamentals Course
#32Really can't decide to go ahead with an Angular approach (2.0) or use React. I know React is only for the view layer so what are people using with React to do stuff like api calls?
If you start using a flux implementation like Redux, there are other interesting things you can do to handle api requests [3].
[1] https://github.com/visionmedia/superagent
[2] https://github.com/facebook/react/wiki/Complementary-Tools#d...
Re: Free React.js Fundamentals Course
#33Really can't decide to go ahead with an Angular approach (2.0) or use React. I know React is only for the view layer so what are people using with React to do stuff like api calls?
Re: Free React.js Fundamentals Course
#34Really can't decide to go ahead with an Angular approach (2.0) or use React. I know React is only for the view layer so what are people using with React to do stuff like api calls?
I've only just started using React but I've been a Django developer for a few years. As I'm starting to use React, I'm still working with Django and Django-Rest-Framework for my backend. It's probably a little heavy weight but you could use something like Flask or whatever equivalent light weight Web framework is in your language of choice.
Re: Free React.js Fundamentals Course
#35Read this: http://reactfordesigners.com/labs/reactjs-introduction-for-p...
If this article does not convince you, React is not for you and that's OK.
Re: Free React.js Fundamentals Course
#36Really can't decide to go ahead with an Angular approach (2.0) or use React. I know React is only for the view layer so what are people using with React to do stuff like api calls?
[1]: https://github.com/matthew-andrews/isomorphic-fetch
[2]: https://github.com/pburtchaell/redux-promise-middleware/blob...
Re: Free React.js Fundamentals Course
#37Really can't decide to go ahead with an Angular approach (2.0) or use React. I know React is only for the view layer so what are people using with React to do stuff like api calls?
I'm using redux for API calls - I like the "single store" approach despite drawbacks vs. flux (or multiple stores).
Re: Free React.js Fundamentals Course
#38Re: Free React.js Fundamentals Course
#39Earlier quoted context omitted.
I've only just started using React but I've been a Django developer for a few years. As I'm starting to use React, I'm still working with Django and Django-Rest-Framework for my backend. It's probably a little heavy weight but you could use something like Flask or whatever equivalent light weight Web framework is in your language of choice.
I think he's asking what to use on the front-end. The author of these tutorials (at least from what I've watched so far) uses axios: https://github.com/mzabriskie/axios
Re: Free React.js Fundamentals Course
#40Really can't decide to go ahead with an Angular approach (2.0) or use React. I know React is only for the view layer so what are people using with React to do stuff like api calls?
/actions: Flux action creators
/components: These are all the JSX React components (the presentation layer) - so there are subfolders like "pages", "controls", etc.
/reducers: These are Redux reducers - they're the logic that handles all of the application state
/services: This is what your question was really about. We use basic ES6 modules for services, with methods like "fetchUser(id)" which use the new JS Fetch API behind the scenes. We then have redux-thunk and redux-promise middleware so we can easily offload state manipulation to these services without actually putting state logic in them.
I've set up a few React projects at this point and this always seems to keep a nice separation of logic. I'm never asking where data is coming from or where it's going. I think Redux has been the biggest difference maker when dealing with all of these parts.
It's no framework, but it's composed of well understood libraries, each with their own important function. You build the structure out yourself so you know exactly how it works, and the pattern will be very familiar to anyone who has used React before.