Safari, the world’s most comprehensive technology and business learning platform.

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required

O'Reilly logo
Learning React

Book Description

Interested in React but find yourself confused about how to use it with the Flux architecture? This is your book. Authors Alex Banks and Eve Porcello show you how to build React applications with the entire React ecosystem—including Flux. You’ll learn about the methodologies behind the creation of the library and its related tools through short interviews with key players in the React community.

Table of Contents

  1. Preface
    1. Conventions Used in This Book
    2. Using Code Examples
    3. O’Reilly Safari
    4. How to Contact Us
    5. Acknowledgments
  2. 1. Welcome to React
    1. History
    2. React is not a Framework
      1. React and MVC
    3. React Ecosystem
    4. Keeping up with the Changes
    5. Working with the Files
      1. File Repository
      2. React Developer Tools
      3. Installing Node.js
  3. 2. Emerging JavaScript
    1. Declaring Variables in ES6
      1. Const
      2. Let
      3. Template Strings
      4. Default Parameters
    2. Arrow Functions
    3. Transpiling ES6
    4. ES6 Objects and Arrays
      1. Destructuring Assignment
      2. Object Literal Enhancement
      3. Spread Operator
    5. Promises
    6. Classes
    7. ES6 Modules
  4. 3. Functional Programming with JavaScript
    1. What it means to be Functional
    2. Imperative vs Declarative
    3. Functional Concepts
      1. Immutability
      2. Pure Functions
      3. Data Transformations
      4. Higher Order Functions
      5. Recursion
  5. 4. Pure React
    1. Page Setup
    2. The Virtual DOM
    3. React Elements
    4. ReactDOM
    5. Children
    6. Constructing Elements with Data
    7. React Components
      1. React.createClass()
      2. React.Component
      3. Stateless Functional Components
    8. DOM Rendering
    9. Factories
  6. 5. React with JSX
    1. React Elements as JSX
      1. JSX Tips
    2. Babel
    3. Recipes as JSX
    4. Babel Presets
    5. Intro to webpack
      1. webpack Loaders
      2. Recipes App with a webpack Build
  7. 6. Props, State, and the Component Tree
    1. Property Validation
      1. Validating Props with createClass
      2. Default Props
      3. Custom Property Validation
      4. ES6 Classes and Stateless Functional Components
    2. Refs
      1. Inverse Data Flow
      2. Refs in Stateless Functional Components
    3. React State Management
      1. Introducing Component State
      2. Initializing State from Properties
    4. State within the Component Tree
      1. Color Organizer App Overview
      2. Passing properties down the component tree
      3. Passing data back up the component tree
  8. 7. Enhancing Components
    1. Component Lifecycles
      1. Mounting Lifecycle
      2. Updating Lifecycle
      3. The Updating Lifecycle Methods
      4. React Children
    2. JavaScript Library Integration
      1. Making Requests with Fetch
      2. Incorporating a D3 Timeline
    3. Higher-Order Components
    4. Managing State Outside Of React
      1. Rendering a Clock
    5. Flux
  9. 8. Redux
    1. State
    2. Actions
      1. Action Payload Data
    3. Reducers
      1. The Color Reducer
      2. The Colors Reducer
      3. The Sort Reducer
    4. The Store
      1. Subscribing to Stores
      2. Saving to localStorage
    5. Action Creators
    6. Middleware
      1. Applying middleware to the store
  10. 9. React Redux
    1. Explicitly Passing the Store
    2. Passing the Store via Context
    3. Presentational vs. Container Components
    4. React Redux Provider
    5. React Redux Connect
  11. 10. Testing
    1. eslint
    2. Testing Redux
      1. Test Driven Development TDD
      2. Testing Reducers
      3. Testing the Store
    3. React Test Utilities Add-on
      1. Shallow Rendering
      2. renderIntoDocument
      3. enzyme
      4. Mocking Components
    4. ES6 Code Coverage with Isparta
  12. 11. React Router
    1. Incorporating the Router
      1. Router Properties
    2. Nesting Routes
      1. Using a Page Template
      2. Subsections and Submenus
    3. Router Parameters
      1. Adding Color Details Page
      2. Moving Color Sort State to Router
  13. 12. React and the Server
    1. Isomorphism vs. Universalism
      1. Server Rendering React
    2. Universal Color Organizer
      1. Universal Redux
      2. Universal Routing
    3. Communicating with the Server
      1. Completing Actions on the Server
      2. Actions with Redux Thunks
  14. Index