untrack
Edit this pageIgnores tracking any of the dependencies in the executing code block and returns the value. This helper is useful when a certain prop
will never update and thus it is ok to use it outside of the reactive context.
import { untrack } from "solid-js"
export function Component(props) { const value = untrack(() => props.value)
return <div>{value}</div> }}
Initial and Default Values
It is not necessary to manually untrack values that are suppose to serve as a default or initial value to a signal. Even with the linter configured to enforce tracking, the linter will accept it when a prop
is prefixed with default
or initial
as it is a common pattern to use them as such.