Live data from Hacker News

Free React.js Fundamentals Course

courses.reactjsprogram.com

51–60 of 117 posts

Re: Free React.js Fundamentals Course

#51
Here's a potentially dumb question about React: can it be used inside a client-side application that was written using Angular?

Part of my job involves customizing a commercial, closed-source web application that lets you build web forms. The application's front-end was written using Angular, but it lets you add your own custom JavaScript to add more functionality to forms, such as character counts, hiding/showing relevant fields based on conditions and auto-capitalization of user input. Basically, each form has its own JSFiddle-like section that gets published alongside the form.

We currently use native JS and JQuery for these customizations, usually within a monolithic document.ready block. The problem is that our code can get pretty complex, especially when hooking up multiple event handlers to the same elements. I've been thinking that React may be able to solve this problem, but I'm uncertain about using it alongside Angular, especially since I have no control over the latter.

Based on this description, would there be any advantages to trying to shoehorn React into our projects, or should we stick with native JS and JQuery?

Re: Free React.js Fundamentals Course

#52
post #5

Earlier quoted context omitted.

Thank you so much! Means the world.

Tyler, I echo the parent's comments. I took your React course on Egghead back in August and it was great. Question: I've been meaning to come back to it and re-watch the videos, but I'm concerned that the React ecosystem changes quickly and they may have become outdated. Can you comment? Do you have plans to update/re-record the videos as new versions of React/Redux/Flux etc. come out? Thanks again for all the great…

The react ecosystem does move really quickly. I think what's important to realize is that even though it moves quickly, if you learn the correct principles you'll just be stuck with minor API changes rather than architectural changes - which is a huge difference. I tried to approach the course from this point of view as well. Even if the API changes a little bit, the overarching methodology of building your UI will be the same. Someone who did the amazingly was Dan Abramov in is egghead series. Learn concepts, not libraries.

Re: Free React.js Fundamentals Course

#54
post #30

Really 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 spent a month playing with the different libraries and settled on the following core modules for my frontend: * redux: Keeps track of all the state (UI and domain) in a single object. * immutable.js: Obviously for the immutable data structures which plays nicely within the React ecosystem. It also has a rich set of data structures that aren't found natively within JavaScript. For example I make heavy use of Records…

Native fetch() and polyfills are also an excellent choice for ajax. There's a comparison of those: http://andrewhfarmer.com/ajax-libraries/

Re: Free React.js Fundamentals Course

#56
post #21

Just started learning js etc. Was told Angularjs has everything loaded so it's easy for beginners, while React is better for the more experienced who knows how to pull various things together? is this true? if so is there a "React-stack" for me to start with?

Don't start with a full stack, it can be overwhelming. Start with a minimal toolkit and only add stuff when you actually run into pain points that it can solve. This guide is a good one:

https://github.com/petehunt/react-howto

Re: Free React.js Fundamentals Course

#58

Here's a potentially dumb question about React: can it be used inside a client-side application that was written using Angular? Part of my job involves customizing a commercial, closed-source web application that lets you build web forms. The application's front-end was written using Angular, but it lets you add your own custom JavaScript to add more functionality to forms, such as character counts, hiding/showing re…

It's possible: http://ngreact.github.io/ngReact/

Re: Free React.js Fundamentals Course

#59
post #40
post #30

Really 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?

Here's a look at the folder structure we're using for our app: https://i.imgur.com/wc7DyOA.png /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…

How does one create a reusable component (something I could publish on npm for example) for React + Redux? The component would have to define its own data expectations, so the actions and reducers would have to be defined by the component. How would you do this, given your folder structure (which I think is very common in Redux/React apps)?

Re: Free React.js Fundamentals Course

#60
post #40

Earlier quoted context omitted.

Here's a look at the folder structure we're using for our app: https://i.imgur.com/wc7DyOA.png /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…

How does one create a reusable component (something I could publish on npm for example) for React + Redux? The component would have to define its own data expectations, so the actions and reducers would have to be defined by the component. How would you do this, given your folder structure (which I think is very common in Redux/React apps)?

Generally you don't actually use Redux in your component. Instead, you'd expose the action creators required by your component. Then the user has to make sure that the new state created from your actions gets back to your component via props. This is a common behaviour I've observed, anyway.
Post reply on HN