Skip to content

Instantly share code, notes, and snippets.

@nightspirit
Last active February 16, 2019 08:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nightspirit/da266266052736eb8aef71835ec13159 to your computer and use it in GitHub Desktop.
Save nightspirit/da266266052736eb8aef71835ec13159 to your computer and use it in GitHub Desktop.
import { useContext } from 'react'
import { AppReducerContext } from 'app'
export default function Foo () {
const [state, dispatch] = useContext(AppReducerContext)
// can read state or dispatch action to appReducer
return (
...
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment