GoConqr has a new look! Let us know what you think.

Flashcards

React

milly larcen React English 10 cards

Cards in this deck (10)

  1. 1React is library or frameworkReact is a JavaScript library for building user interfaces. It is maintained by Facebook and a community of individual developers and companies. React can be used as a base in the development of single-page or mobile applications.
  2. 2library vs frameworklibrary is a collection of functions, and a framework is a way of doing things. y this definition, React is a framework because it forces you to build UI in the React way as opposed to the Angular or Ember, etc. way.
    On the other hand lodash is a perfect example of a library because it's just a collection of functions, use them however you like.
  3. 3what is frameworkframework has to bring stuff like routers and/or widgets etc. pp. So Angular, Ember.js and ExtJS are frameworks, but React isn't, because it only gives you the means to build components and render them into the DOM.
    We use React very much like JQuery, simply bringing it in as a dependency. However, we use Webpack to facilitate React development by sprinkling some JSX in the mix. Without Webpack, we'd have to write all of our elements in a very cumbersome API that is pure JS. Webpack also let's us optimize tons of other things in the background such as cross-browser compatibility. So, this whole magical setup of a React project with Webpack using create-react-app is what gives us the false impression it is framework
    when we compare what React provides us to Angular, we notice that React is just a component library when compared to Angular's routing, dependency injection, module management, etc. Also, Angular has some very opinionated ways of organizing the code base whereas React doesn't. When we use React, all of these additional features have to come from some other library
  4. 4React is a libraryReact is distributed as a single npm install. It does one thing and does it very well.
    React by itself doesn’t do all the pieces. Instead, it intends to be bolted onto an existing stack.
    React is non-invasive. For almost everything it does, if you would rather use something else, you can. Most of it’s features are opt in. Heck, even the render itself is opt in.
  5. 5React is a frameworkAbout 99% of what you want to do on the client can be done with only React as a library (and react specific components distributed as part of its ecosystem).
    It is a full-featured dom manipulation and state engine
    It has some strongly opinionated ideas about how companion libraries should work (flux specification, graphql specification)
  6. 6What is side effect?Impure functions. A "side effect" is anything that affects something outside the scope of the function being executed. ... Functions that execute without side effects are called "pure" functions: they take in arguments, and they return values. Nothing else happens upon executing the function
  7. 7side effect in reactThese can be a network request, which has your code communicating with a third party (and thus making the request, causing logs to be recorded, caches to be saved or updated, all sorts of effects that are outside the function.
    Changing the value of a closure-scoped variable is a side effect. Pushing a new item onto an array that was passed in as an argument is a side effect.
  8. 8side effect reduxThe natural Redux flow is this: some action is dispatched, and as a consequence, some state is changed.
    If all Redux app could do was just to change state, would app be particularly useful? Probably not.
    Most apps need to reach out to the outside world to be useful — whether by talking to the server, accessing local storage, recording analytics events, or something else entirely.
    That process of calling into the real world is what side-effects are. They are a way of bridging the pure Redux world with the outside world.
  9. 9Common features of redux side-effectsSide-effects can happen in response to Redux actions. For example, when a user clicks “Save,” you may want to fire off an AJAX request.
    Side-effects may dispatch Redux actions. Like when the save process finishes successfully, you may want to dispatch SAVE_SUCCEEDED; or when it failed, SAVE_FAILED.
    They also may not dispatch anything. Some side-effects don’t need to dispatch anything: if you are doing analytics tracking based on Redux actions, you would track things in response to Redux actions, but you will not dispatch anything.
  10. 10What kinds of approaches are there to handling redux side-effects?There are three primary ways of performing side-effects:
    1. Inside action creators.
    2.Have some code on the side respond to user actions.
    3.Specialized middleware
    https://goshakkk.name/redux-side-effect-approaches/

Information

Description
React Flashcards on React, created by milly larcen on 15/05/2020.
Created by
milly larcen
Views
1
Rating

Feedback

What is it about?

What do you think of the new look?

How do you like it?