What is the relation and difference between React, ReactJS, React Native, React router, reactive programming, and RxJava?

  1. React - A framework
  2. ReactJS Another name for 1.
  3. React Native. A version of React that allows you to create mobile apps. Learn 1 first.
  4. React Router - a router, which is a way to split your application into pages and navigate to them on user interaction. You need to learn React Router soon after React to create most applications, or write something that does the same thing yourself. Using React Router is preferable because it gives you urls for each section in your app, such as /login, /settings, etc.
  5. Reactive Programming is a general name for types of programming designed to respond to change, such as incoming data and user interaction. You don’t need to consider this for now as 1 is a solution to this.
  6. ReactiveX is one of a number of libs you may use to make life easier, and comes in several language specific versions (e.g. RxJava). If you don’t know what it is, you probably don’t need it yet. ImmutableJS is another common one that comes up. You will never need that one (it is built for scale but doesn’t actually scale well, only in JavaScript!, etc). Write your own clone function instead; its a simple 5 line recursive function.

Oh, and you missed Redux. You need that right after 1 (despite its position way down in a Google search for ‘React’). It’s to do with how you manage application data and state (not to be confused with this.state within a component, which should be used for local component concerns requiring a component redraw on change). Also GraphQL/Relay once you advance. Its the way forward.


For 6, here’s the clone function I use (okay, its actually 9 lines, and it expects to be in class StoreHelpers unless you change lines 1 and 6).

 static deepClone(obj) {
   var out, val, key;
   out = Array.isArray(obj) ? [] : {};
   for (key in obj) {
     val = obj[key];
     out[key] = (typeof val === "object") ? StoreHelpers.deepClone(val) : val;
   }
  return out;
 }

There’s also a mergeBIntoA() function I use a lot with React. Its in some of my other answers, and should help a lot when you get into Redux.

#react-native

4 Likes14.65 GEEK