createMutable
Edit this pagecaution
In Solid 2.0, createMutable has been removed from solid-js/store and moved to the @solidjs/signals package. If you depend on mutable store patterns, you will need to install and import from @solidjs/signals instead.
Migration
Update your imports from:
// Solid 1.x (no longer works in 2.0)import { createMutable } from "solid-js/store";To:
// Solid 2.0import { createMutable } from "@solidjs/signals";Usage (via @solidjs/signals)
createMutable creates a new mutable Store proxy object that provides a way to selectively trigger updates only when values change. By intercepting property access, it allows automatic tracking of deep nesting via proxy.
import { createMutable } from "@solidjs/signals";
const state = createMutable({ someValue: 0, list: [],});
// read valuestate.someValue;
// set valuestate.someValue = 5;
state.list.push(anotherValue);note
In Solid 2.0, the recommended approach for most use cases is createStore with its new draft-first setter pattern, which provides the ergonomic benefits of mutable-style updates while maintaining unidirectional data flow.