Last active
February 8, 2021 16:43
-
-
Save wissalHaji/388557336857cc36511c18708563aad6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { createContext, useContext } from "react"; | |
const Context = createContext(); | |
export function DrizzleProvider({ drizzle, children }) { | |
return <Context.Provider value={drizzle}>{children}</Context.Provider>; | |
} | |
export function useDrizzleContext() { | |
const context = useContext(Context); | |
return context; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment