Store utilities

createMutable

Edit this page

Migration

Update your imports from:

// Solid 1.x (no longer works in 2.0)
import { createMutable } from "solid-js/store";

To:

// Solid 2.0
import { 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 value
state.someValue;
// set value
state.someValue = 5;
state.list.push(anotherValue);
Report an issue with this page