Radioactive State
JavaScript proxy based reactive state management library for React
Radioactive state library creates a reactive state for React. When it is mutated at any level (shallow or deep) it re-renders the component automatically. No need to set the state, no need to use libraries like immer.js to produce a new state - just mutate your state, that's it!
- Deeply Reactive - mutate state at any level to update
- No extra re-renders - auto mutation batching
- Always fresh state, unlike useState
- Reactive bindings for inputs
- Zero dependencies, ultra light-weight < 1kb
Mutate to trigger re-render
Create a radioactive state with useRS and just mutate it to trigger re-renders.
Mutation Batching
Mutations are batched into a single update. No matter how many times you mutate the state, it only triggers one re-render.
Reactive Bindings
Bind inputs to state with state.$key syntax. It handles value, onChange, and type conversions automatically.
Always Fresh State
With useState, the state value only updates after a re-render.
With useRS, state is mutated directly