@mui/internal-docs-infra
Version:
MUI Infra - internal documentation creation tools.
25 lines (20 loc) • 899 B
JavaScript
'use client';
import * as React from 'react';
/** Represents any imported module or object that can be provided as an external dependency */
/**
* Context interface for providing external dependencies to demo components.
* Used by demo client providers to make precomputed externals available to child components.
*/
/**
* React context for managing external dependencies in demo components.
* Primarily used internally by demo client providers created with abstractCreateDemoClient.
*/
export const CodeExternalsContext = /*#__PURE__*/React.createContext(undefined);
/**
* Hook to access external dependencies from the CodeExternalsContext.
* Returns undefined if used outside of a provider.
*/
if (process.env.NODE_ENV !== "production") CodeExternalsContext.displayName = "CodeExternalsContext";
export function useCodeExternals() {
return React.useContext(CodeExternalsContext);
}