UNPKG

@prismai/prism-ladle

Version:

Enhanced component development environment based on Ladle, with multi-project support

16 lines (13 loc) 444 B
import * as React from "react"; //@ts-ignore import LadleContext from "@ladle/react-context"; import type { GlobalAction, GlobalState } from "../../shared/types"; export const Context: React.Context<{ globalState: GlobalState; dispatch: React.Dispatch<GlobalAction>; }> = LadleContext; export const useLadleContext = () => React.useContext<{ globalState: GlobalState; dispatch: React.Dispatch<GlobalAction>; }>(LadleContext);