({
children,
doc,
path,
minimal,
}: {
children: ReactNode;
doc: JSONDocument;
path?: string;
minimal?: boolean;
})
| 11 | const JsonDocContext = createContext<JsonDocType | undefined>(undefined); |
| 12 | |
| 13 | export function JsonDocProvider({ |
| 14 | children, |
| 15 | doc, |
| 16 | path, |
| 17 | minimal, |
| 18 | }: { |
| 19 | children: ReactNode; |
| 20 | doc: JSONDocument; |
| 21 | path?: string; |
| 22 | minimal?: boolean; |
| 23 | }) { |
| 24 | return ( |
| 25 | <JsonDocContext.Provider value={{ doc, path, minimal }}> |
| 26 | {children} |
| 27 | </JsonDocContext.Provider> |
| 28 | ); |
| 29 | } |
| 30 | |
| 31 | export function useJsonDoc(): JsonDocType { |
| 32 | const context = useContext(JsonDocContext); |
nothing calls this directly
no outgoing calls
no test coverage detected