View on GitHub

reading-notes

Putting it all together

One of the many great parts of React is how it makes you think about apps as you build them. In this document, we’ll walk you through the thought process of building a searchable product data table using React.

### Start With A Mock

The mock looks like this:

Drag Racing

Our JSON API returns some data that looks like this:

[
  {category: "Sporting Goods", price: "$49.99",     stocked: true, name: "Football"},
  {category: "Sporting Goods", price: "$9.99",     stocked: true, name: "Baseball"},
  {category: "Sporting Goods", price: "$29.99",     stocked: false, name: "Basketball"},
  {category: "Electronics", price: "$99.99", stocked:     true, name: "iPod Touch"},
  {category: "Electronics", price: "$399.99", stocked:     false, name: "iPhone 5"},
  {category: "Electronics", price: "$199.99", stocked:     true, name: "Nexus 7"}
];

Step 1: Break The UI Into A Component Hierarchy

img

Step 2: Build A Static Version in React

Step 3: Identify The Minimal (but complete) Representation Of UI State

Step 4: Identify Where Your State Should Live

Step 5: Add Inverse Data Flow


refrences :