Browse Source

Add diagram to Reacting to Input with State (#4434)

main
Ricky 3 years ago
committed by GitHub
parent
commit
2f05f3f3d2
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 20
      beta/public/images/docs/diagrams/responding_to_input_flow.dark.svg
  2. 20
      beta/public/images/docs/diagrams/responding_to_input_flow.svg
  3. BIN
      beta/public/images/docs/sketches/s_flow-chart.jpg
  4. 10
      beta/src/pages/learn/reacting-to-input-with-state.md

20
beta/public/images/docs/diagrams/responding_to_input_flow.dark.svg

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 56 KiB

20
beta/public/images/docs/diagrams/responding_to_input_flow.svg

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 56 KiB

BIN
beta/public/images/docs/sketches/s_flow-chart.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 314 KiB

10
beta/src/pages/learn/reacting-to-input-with-state.md

@ -332,7 +332,15 @@ In both cases, **you must set [state variables](/learn/state-a-components-memory
To help visualize this flow, try drawing each state on paper as a labeled circle, and each change between two states as an arrow. You can sketch out many flows this way and sort out bugs long before implementation.
<img alt="A flow chart showing states and transitions between them" src="/images/docs/sketches/s_flow-chart.jpg" />
<DiagramGroup>
<Diagram name="responding_to_input_flow" height={350} width={688} alt="Flow chart moving left to right with 5 nodes. The first node labeled 'empty' has one edge labeled 'start typing' connected to a node labeled 'typing'. That node has one edge labeled 'press submit' connected to a node labeled 'submitting', which has two edges. The left edge is labeled 'network error' connecting to a node labeled 'error'. The right edge is labeled 'network success' connecting to a node labeled 'success'.">
Form States
</Diagram>
</DiagramGroup>
### Step 3: Represent the state in memory with `useState` {/*step-3-represent-the-state-in-memory-with-usestate*/}

Loading…
Cancel
Save