carbon-react
Version:
A library of reusable React components for easily building user interfaces.
17 lines (16 loc) • 625 B
TypeScript
/**
* Provides context which can be used to dynamcally track the depth of a component
* in the component tree. This is useful for components that need to know their depth
* in the tree for styling or layout purposes.
*/
import React, { ReactNode } from "react";
declare const DepthContext: React.Context<number>;
export declare const useDepth: () => number;
export declare const DepthProvider: ({ children, value, }: {
children: ReactNode;
value?: number;
}) => React.JSX.Element;
export declare const IncreaseDepth: ({ children }: {
children: ReactNode;
}) => React.JSX.Element;
export default DepthContext;