Use the same API as useState React hook for transverse state management 💪
Usage
Installation
Make sure you run in a project using React v16.7 or higher
$ yarn add reaktion
In your code
; const Hello = { /** * The first element is the state node * The second element is a function that mutates only that node **/ const name setName = ; return <button onClick= >Hello name</button>;}; /** * Initial transverse node **/const initialState = name: "World" ; const App = { /** * Reaktion is the state provider. It must be placed at a top level of your app **/ return <Reaktion initialState=initialState> <Hello /> </Reaktion> ;};