Hey Devs! ๐
I recently open-sourced a small utility called react-refsignal, a lightweight React hook library inspired by Preact Signals. It lets you create reactive references that you can watch for update in your components. It works exactly like useRef, useEffect, useMemo, but with direct invocation like signals. You can then trigger effects, recomputations, or re-renders where needed.
Why I built it
Preact Signals are great, but they introduce a different pattern not particularly easy to integrate into a codebase. With RefSignal however i could enjoy working with regular react api, well through new hooks but with same intended behaviour.
Features
- ๐ Reactive refs that can be updated, and watched for
- ๐ง Familiar API for React developers
- โก Lightweight and dependency-free
- ๐งช Great for building reactive UIs with minimal code
Try it out
- GitHub: https://github.com/jav974/react-refsignal
- npm: npm install react-refsignal
Iโd love to hear your thoughtsโfeedback, issues, or even just a star if you find it useful. Thanks for reading, and happy coding! ๐
Top comments (0)