UNPKG

@wordpress/components

Version:
28 lines • 1.16 kB
import type { ReactNode } from 'react'; type ContextSystemValue = Record<string, Record<string, unknown> | undefined>; export declare const ComponentsContext: import("react").Context<ContextSystemValue>; export declare const useComponentsContext: () => ContextSystemValue; /** * A Provider component that can modify props for connected components within * the Context system. * * @example * ```jsx * <ContextSystemProvider value={{ Button: { size: 'small' }}}> * <Button>...</Button> * </ContextSystemProvider> * ``` * * @template {Record<string, any>} T * @param {Object} options * @param {React.ReactNode} options.children Children to render. * @param {T} options.value Props to render into connected components. * @return {React.JSX.Element} A Provider wrapped component. */ declare const BaseContextSystemProvider: ({ children, value, }: { children: ReactNode; value?: ContextSystemValue; }) => import("react").JSX.Element; export declare const ContextSystemProvider: import("react").MemoExoticComponent<typeof BaseContextSystemProvider>; export {}; //# sourceMappingURL=context-system-provider.d.ts.map