Skip to content

Commit

Permalink
readme minor changes
Browse files Browse the repository at this point in the history
Yair Even Or authored and Yair Even Or committed Jul 20, 2022
1 parent 006f9df commit cd4fabe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -13,10 +13,10 @@
</a>
</p>

Keep (or place) all the state at parent-component-level, as refs, and pass it to the sub-components with props or context.<br>
Keep (or place) all the state at parent-component-level, as refs, and pass it to the sub-components with props or context.
(I prefer context so deeply nested comopnents can access the state without drilling-down the props).

This solves the problem where a child updates a state defined at some top-parent level which is causing the parent to re-render.
This solves the problem where a child updates a state defined at some top-level parent which is causing the parent to re-render and possibly other children.

Each sub-component can register a listener for changes in a specific `ref` or any of its `.current` properties (assuming `current` points to a mutated Object/Array).

0 comments on commit cd4fabe

Please sign in to comment.