Skip to content

Commit 4802f2a

Browse files
committed
docs: clarify usage of proxy object in array update example
1 parent a58ca5e commit 4802f2a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

docs/how-tos/how-to-update-values-inside-arrays.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ function CounterList() {
7777
<h1>{snap.title}</h1>
7878
{/* Only the length is accessed from snap, so only updated children re-render */}
7979
{Array.from({ length: snap.items.length }, (_, index) => (
80+
{/* Note that we are passing the proxy object (state) instead of the snapshot (snap) to the child component */}
8081
<Counter key={state.items[index].id} item={state.items[index]} />
8182
))}
8283
</div>

0 commit comments

Comments
 (0)