A talk about the React world.
Created by Benjamim Sonntag for a siosLIFE talk & roll.
"A JavaScript library for building user interfaces."
Made by Facebook and Instagram
Makes no assumptions about the rest of the application.
It's the V in MVC.
No overload of features to explore (and get lost in).
Fast to start using.
Used for efficient re-rendering of the DOM.
The DOM is only updated when the virtual DOM changes, and only the parts that change are updated.
React is all about building components.
Components are not templates.
Components unify markup with its view logic.
(Yes, JavaScript and HTML in the same file. Yuck...)
Components should be encapsulated and reusable.
Makes them easier to maintain.
A component's properties are changed by its parent.
The state is updated by the component itself or by external events.
When the state is updated, the view will re-render itself.
Components can be seen as state machines.
The object passed to React.createClass() specifies the component's methods, including lifecycle methods.
Must return a single DOM element, that can be another React component or a native DOM element (like a <div>)
The render method is required.
Values in the returned object will be set on this.props
if that prop is not specified by the parent component.
Invoked once and cached when the class is created.
The return value will be used as the initial value of this.state.
Invoked before a component is mounted.
Merges nextState into the current state.
Clears the component's state and sets it to nextState.
"Application Architecture for Building User Interfaces."
Complements React's composable view components by utilizing a unidirectional data flow.
The dispatcher is the central hub that manages all data flow.
Receives actions from views and external sources
and sends them to the stores.
Contain the application state and logic.
Actions result in updates to the state of the store.
After the stores are updated, they broadcast an event declaring that their state has changed.
Views listen for events that are broadcasted by the stores.
When an event is received, the view requests the new state via the stores's public getters.
"Predictable state container for JavaScript applications."
"A framework for building native apps using React."
All operations between the JavaScript application code and the native platform are performed asynchronously.
Provides polyfils for most browser APIs, like XMLHttpRequest.
There are also many packages on npm that polyfil other browser APIs, like WebRTC.
Uses a JavaScript runtime, but the UI is not HTML.
Provides a native-level performance and look and feel.