You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{% include "../../examples/json/thinking_in_react/start_with_the_mockup.json" %}
48
21
```
49
22
50
23
The mockup looks like this:
@@ -91,125 +64,35 @@ Now that you've identified the components in the mockup, arrange them into a hie
91
64
92
65
Now that you have your component hierarchy, it's time to implement your app. The most straightforward approach is to build a version that renders the UI from your data model without adding any interactivity... yet! It's often easier to build the static version first and add interactivity later. Building a static version requires a lot of typing and no thinking, but adding interactivity requires a lot of thinking and not a lot of typing.
93
66
94
-
To build a static version of your app that renders your data model, you'll want to build [components](your-first-component.md) that reuse other components and pass data using [props.](/learn/passing-props-to-a-component) Props are a way of passing data from parent to child. (If you're familiar with the concept of [state](/learn/state-a-components-memory), don't use state at all to build this static version. State is reserved only for interactivity, that is, data that changes over time. Since this is a static version of the app, you don't need it.)
67
+
To build a static version of your app that renders your data model, you'll want to build [components](your-first-component.md) that reuse other components and pass data using [props.](../learn/passing-props-to-a-component.md) Props are a way of passing data from parent to child. (If you're familiar with the concept of [state](../learn/state-a-components-memory.md), don't use state at all to build this static version. State is reserved only for interactivity, that is, data that changes over time. Since this is a static version of the app, you don't need it.)
95
68
96
69
You can either build "top down" by starting with building the components higher up in the hierarchy (like `filterable_product_table`) or "bottom up" by working from components lower down (like `product_row`). In simpler examples, it’s usually easier to go top-down, and on larger projects, it’s easier to go bottom-up.
(If this code looks intimidating, go through the [Quick Start](/learn/) first!)
85
+
```python
86
+
# TODO
87
+
```
205
88
206
-
After building your components, you'll have a library of reusable components that render your data model. Because this is a static app, the components will only return JSX. The component at the top of the hierarchy (`filterable_product_table`) will take your data model as a prop. This is called _one-way data flow_ because the data flows down from the top-level component to the ones at the bottom of the tree.
89
+
(If this code looks intimidating, go through the [Quick Start](../learn/get-started.md) first!)
207
90
208
-
<Pitfall>
91
+
After building your components, you'll have a library of reusable components that render your data model. Because this is a static app, the components will only return non-interactive HTML. The component at the top of the hierarchy (`filterable_product_table`) will take your data model as a prop. This is called _one-way data flow_ because the data flows down from the top-level component to the ones at the bottom of the tree.
209
92
210
-
At this point, you should not be using any state values. That’s for the next step!
93
+
!!! warning "Pitfall"
211
94
212
-
</Pitfall>
95
+
At this point, you should not be using any state values. That’s for the next step!
213
96
214
97
## Step 3: Find the minimal but complete representation of UI state
0 commit comments