@mui/internal-docs-infra
Version:
MUI Infra - internal documentation creation tools.
15 lines (13 loc) • 583 B
JavaScript
'use client';
import * as React from 'react';
/**
* Supplies the lazily-resolved client `StreamSource` to descendant chunks.
* `undefined` outside a `ChunkProvider` - a chunk then relies on its own config
* source (or stays in its loading/preloaded state).
*/
export const ChunkContext = /*#__PURE__*/React.createContext(undefined);
/** Read the surrounding `ChunkProvider`, or `undefined` when there is none. */
if (process.env.NODE_ENV !== "production") ChunkContext.displayName = "ChunkContext";
export function useChunkContext() {
return React.useContext(ChunkContext);
}