Skip to content

Instantly share code, notes, and snippets.

@wissalHaji
Last active February 8, 2021 16:43
Show Gist options
  • Save wissalHaji/388557336857cc36511c18708563aad6 to your computer and use it in GitHub Desktop.
Save wissalHaji/388557336857cc36511c18708563aad6 to your computer and use it in GitHub Desktop.
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