solidjs/solid-docs

[Content]: Document the lack of reactivity when mutating objects or arrays returned by `createSignal`

開放

#1,621 建立於 2026年8月11日

 (0 則留言) (0 個反應) (0 位負責人)MDX (363 個分叉)github user discovery
good first issuesolid

倉庫指標

星標
 (289 顆星)
PR 合併指標
 (平均合併 1天 15小時) (30 天內合併 24 個 PR)

描述

📚 Subject area/topic

src/routes/(0)concepts/(2)signals.mdx

📋 Page(s) affected (or suggested, for new content)

/concepts/signals

📋 Description of content that is out-of-date or incorrect

If you create pass an array/object to createSignal, any changes to the underlying object won't be tracked by the reactivity system. Example:

const [arraySig, setArraySig] = createSignal([1, 2, 3]);
const copy = arraySig();
copy.push(...copy.slice(-3).map(x => x + 3));
console.log(arraySig()); /* `arraySig()` is now [1, 2, 3, 4, 5, 6], but UI won't update and effects won't rerun */

I believe this behaviour has to be documented.

🖥️ Reproduction in StackBlitz (if reporting incorrect content or code samples)

No response

貢獻者指南