1.0.0 • Published 5 years ago
use-reactive-value v1.0.0
use-reactive-value
YOU DON'T NEED setState!! A tiny(0.2kb gzipped) react hooks library that provides true reactivity inspired by vue3
How to use
// with use-reactive-value
const state = useReactive({ foo: 'bar', abc: 123, toggle: false });
state.foo = 'baz';
state.abc = 234;
// without use-reactive-value
const [foo, setFoo] = useState('bar');
const [abc, setAbc] = useState(123);
const [toggle, setToggle] = useState(false);
setFoo('baz');
setAbc(234);
1.0.0
5 years ago