ReactJS Flashcards
What is React?
React is an open-source JavaScript library created by Facebook for building complex, interactive UIs in web and mobile applications
How is React different from other JS frameworks?
React is a small library focused on building UI components
React focuses exclusively on the creation of components
allows a developer an incredible amount of flexibility in choosing the architecture they deem “best”
What happens during the lifecycle of a React High-Level component?
React components have lifecycle events that fall into three general categories:
Initialization
State/Property Updates
Destruction
Every React component defines these events as a mechanism for managing its properties, state, and rendered output
What happens during the lifecycle of a React Low-Level component?
Within these three general buckets exist a number of specific lifecycle hooks — essentially abstract methods — that can be utilized by any React component to more accurately manage updates
events under “Initialization” only happen when a component is first initialized or added to the DOM
events under “Destruction” only happen once when the component is removed from the DOM
events under “Update” happen every time the properties or state of the component change
components will automatically re-render themselves any time their properties or state change
What is JSX?
embeds raw HTML templates inside JavaScript code
JSX code by itself cannot be read by the browser - it must be transpiled into traditional JavaScript using tools like Babel and webpack
What is Flux?
an architectural pattern that enforces unidirectional data flow
its core purpose is to control derived data so that multiple components can interact with that data without risking pollution
The Flux pattern is generic
Action ➡️ Dispatcher ➡️ Store ➡️ View
What are state-less components?
a flavor of “reusable” components
pure functions that render DOM based solely on the properties provided to them
The component has no need for any internal state — let alone a constructor or lifecycle handlers
The output of the component is purely a function of the properties provided to it