preact signals, how to do rendering optimization on non-primitive values

57 views Asked by At

in the README of preact signals, it introduces a rendering optimizations https://github.com/preactjs/signals/blob/main/packages/preact/README.md#rendering-optimizations

simply pass the signal directly instead of accessing the .value property.

but if I create an array signal, like a todo list

const todos = signal([
  { text: "Buy groceries" },
  { text: "Walk the dog" },
]);

how do I do the rendering optimization on it?

or does it mean the optimization is only for simple primitive values like strings or numbers?

0

There are 0 answers