usegstate
v1.0.1
Published
react library for creating global states in most easy way
Downloads
1
Readme
usegstate
The simplest way to create Global States.
Install
npm install --save usegstate
Usage
Create Global State
import { gState } from 'usegstate'
const myGlobalState = gState('hello-world!')
Use Global State
import useGState from 'usegstate'
const GenderGetter = () => {
const [gState,setGState] = useGState(myGlobalState)
return (
<div>{gState}</div>
)
}
Don't forget to wrap your app inside GStateProvider
import {GStateProvider} from 'usegstate'
const Wrapper = () => {
return (
<GStateProvider>
<YourWonderfullApp />
</GStateProvider>
)
}
License
MIT © amit231