Closed winkyBrain closed 5 months ago
It’s will work only with Preact, but for React you should use Babel plugin or function “useSignals()” for make a component reactive.
import { useSignals } from "@preact/signals-react/runtime";
const count = signal(0);
function CounterValue() {
useSignals();
return <p>Value: {count.value}</p>;
}
Please don't upgrade majors without reading the docs to see what's changed.
https://github.com/preactjs/signals/tree/main/packages/react#react-integration
It's working fine on 1.3.6 version, but after update to version 2.0.0 expected behavior is broken. Example