Skip to content

xuanhuan95/react-state-utils

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

react-state-utils

manage state global reactjs project

ConnectGlobalState

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

About

Utils used for react state

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%