manage state global reactjs project
Usage
- Connect Component to state global
class App extends Component {
render() {
return (
<div>
<h3>App Component</h3>
</div>
);
}
}
export default connectGlobalState(App);
- Set state global
this.setGlobalState({ [stateName]:[stateValue] })
this.setGlobalState({name:'Bob'})
- Get state global
this.globalState.[stateName]
this.globalState.name //Bob