UNPKG

@primer/react

Version:

An implementation of GitHub's Primer Design System using React

12 lines (11 loc) 436 B
import { createContext, useContext } from "react"; //#region src/Blankslate/BlankslateContext.ts const BlankslateContext = /*#__PURE__*/ createContext(null); function useBlankslate() { const context = useContext(BlankslateContext); if (!context) throw new Error("useBlankslate must be used within a BlankslateProvider"); return context; } const Provider = BlankslateContext.Provider; //#endregion export { Provider, useBlankslate };