Skip to content

Commit 6e4e949

Browse files
authored
Update README.md
1 parent 91bb344 commit 6e4e949

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

README.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -160,26 +160,27 @@ b.list[0].count.value === 0 // true
160160

161161
<details>
162162
<summary>
163-
<b>Should</b> always use <code>ref</code> in a <code>reactive</code> when working with <code>Array</code>
163+
<b>Should</b> always use <code>ref</code> in a <code>reactive</code> when working with <code>Array</code>
164164
</summary>
165165

166166
```js
167167
const a = reactive({
168-
count: ref(0),
169-
})
170-
const b = reactive({
171-
list: [a],
168+
list: [
169+
reactive({
170+
count: ref(0),
171+
})
172+
],
172173
})
173174
// unwrapped
174-
b.list[0].count === 0 // true
175+
a.list[0].count === 0 // true
175176

176-
b.list.push(
177+
a.list.push(
177178
reactive({
178179
count: ref(1),
179180
})
180181
)
181182
// unwrapped
182-
b.list[1].count === 1 // true
183+
a.list[1].count === 1 // true
183184
```
184185

185186
</details>

0 commit comments

Comments
 (0)