react-estate
simple universal react state, the easiest way to setup global app state.
Getting Started
yarn add react-estate
ornpm install react-estate
Usage
Add state provider at your initial entry point of your application usually index.js
.
; StateProvider defaultState= App //StateProvider;
use state across your application - example.
;;
read state on a different component to access the shared state.
;;
Available Props for StateProvider
prop | default | type | description |
---|---|---|---|
children | null | node | Required: React component |
defaultState | {} | object | Optional: initial app state |
reducer | old,new | void | Optional: controled update |
Example usage at: Multiplayer