Skip to content

Commit 9546b52

Browse files
committed
clean up docs
1 parent e8ae05a commit 9546b52

File tree

10 files changed

+63
-37
lines changed

10 files changed

+63
-37
lines changed

docs/source/_custom_js/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/source/_static/css/furo-theme-overrides.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,7 @@ body {
22
--admonition-title-font-size: 1rem !important;
33
--admonition-font-size: 1rem !important;
44
}
5+
6+
.sidebar-container {
7+
width: 16em;
8+
}

docs/source/managing-state/index.rst

Lines changed: 48 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,58 @@ Managing State
44
.. toctree::
55
:hidden:
66

7-
keeping-components-pure
8-
logical-flow-of-state
9-
structuring-your-state
7+
structuring-your-state/index
108
shared-component-state/index
11-
when-to-reset-state
12-
writing-tests
9+
when-and-how-to-reset-state/index
1310

11+
.. dropdown:: :octicon:`bookmark-fill;2em` What You'll Learn
12+
:color: info
13+
:animate: fade-in
14+
:open:
15+
16+
.. grid:: 1 2 2 2
17+
18+
.. grid-item-card:: :octicon:`code-square` Structuring Your State
19+
:link: structuring-your-state/index
20+
:link-type: doc
21+
22+
Make it easy to reason about your application by organizing its state.
23+
24+
.. grid-item-card:: :octicon:`link` Shared Component State
25+
:link: shared-component-state/index
26+
:link-type: doc
27+
28+
Allow components to vary vary together, by lifting state into common
29+
parents.
30+
31+
.. grid-item-card:: :octicon:`light-bulb` When and How to Reset State
32+
:link: when-and-how-to-reset-state/index
33+
:link-type: doc
34+
35+
Control if and how state is preserved by understanding it's relationship to
36+
the "UI tree".
1437

1538

1639
Section 4: Shared Component State
1740
---------------------------------
1841

19-
Sometimes you want the state of two components to always change together. To do it, you
20-
need to be able to share state between those two components, to share state between
21-
componets move state to the nearest parent. In React world this is known as "lifting
22-
state up" and it is a very common thing to do. Let's look at 2 examples, also from
23-
`React <https://beta.reactjs.org/learn/sharing-state-between-components>`__,
24-
but translated to IDOM.
42+
Sometimes, you want the state of two components to always change together. To do it,
43+
remove state from both of them, move it to their closest common parent, and then pass it
44+
down to them via props. This is known as “lifting state up”, and it’s one of the most
45+
common things you will do writing code with IDOM.
46+
47+
In the example below the search input and the list of elements below share the same
48+
state, the state represents the food name. Note how the component ``Table`` gets called
49+
at each change of state. The component is observing the state and reacting to state
50+
changes automatically, just like it would do in React.
51+
52+
.. idom:: shared-component-state/_examples/synced_inputs
53+
54+
.. card::
55+
:link: shared-component-state/index
56+
:link-type: doc
57+
58+
:octicon:`book` Read More
59+
^^^^^^^^^^^^^^^^^^^^^^^^^
60+
61+
Allow components to vary vary together, by lifting state into common parents.

docs/source/managing-state/keeping-components-pure.rst

Lines changed: 0 additions & 8 deletions
This file was deleted.

docs/source/managing-state/logical-flow-of-state.rst

Lines changed: 0 additions & 8 deletions
This file was deleted.

docs/source/managing-state/shared-component-state/index.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@ Shared Component State
33

44

55
Sometimes you want the state of two components to always change together. To do it, you
6-
need to be able to share state between those two components, to share state between
7-
componets move state to the nearest parent. In React world this is known as "lifting
8-
state up" and it is a very common thing to do. Let's look at 2 examples, also from
9-
`React <https://beta.reactjs.org/learn/sharing-state-between-components>`__,
6+
need to be able to share state between those two components, to share state between
7+
components move state to the nearest parent. In React world this is known as "lifting
8+
state up" and it is a very common thing to do. Let's look at 2 examples, also from
9+
`React <https://beta.reactjs.org/learn/sharing-state-between-components>`__,
1010
but translated to IDOM.
1111

1212
Synced Inputs
1313
-------------
1414

15-
In the code below the two input boxes are syncronized, this happens because they share
15+
In the code below the two input boxes are synchronized, this happens because they share
1616
state. The state is shared via the parent component ``SyncedInputs``. Check the ``value``
1717
and ``set_value`` variables.
1818

@@ -25,7 +25,7 @@ In the example below the search input and the list of elements below share the
2525
same state, the state represents the food name.
2626

2727
Note how the component ``Table`` gets called at each change of state. The
28-
component is observing the state and reacting to state changes automatically,
28+
component is observing the state and reacting to state changes automatically,
2929
just like it would do in React.
3030

3131
.. idom:: _examples/filterable_list

docs/source/managing-state/when-to-reset-state.rst renamed to docs/source/managing-state/when-and-how-to-reset-state/index.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.. _When to Reset State:
22

3-
When to Reset State 🚧
4-
======================
3+
When and How to Reset State 🚧
4+
==============================
55

66
.. note::
77

docs/source/understanding-idom/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ Understanding IDOM
1010
why-idom-needs-keys
1111
the-rendering-process
1212
layout-render-servers
13+
writing-tests

0 commit comments

Comments
 (0)