Skip to content

Instantly share code, notes, and snippets.

@radiosilence
Created March 23, 2020 23:45
Show Gist options
  • Save radiosilence/1e6c4760f87f99b276b58e71fc86439e to your computer and use it in GitHub Desktop.
Save radiosilence/1e6c4760f87f99b276b58e71fc86439e to your computer and use it in GitHub Desktop.
import { MobXProviderContext } from "mobx-react"
import { useContext } from "react"
import { RootStore } from "../models"
export const useStores = () => {
return useContext(MobXProviderContext)
}
export const useRootStore = (): RootStore => useStores().rootStore
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment