@shopify/polaris
Version:
Shopify’s admin product component library
18 lines (17 loc) • 542 B
TypeScript
/**
* Similarly to the life-cycle method componentDidMount, useComponentDidMount
* will be invoked after the component has mounted, and only the initial mount.
* @param callback Defines a callback to invoke once the component has
* initially mounted.
* @example
* function Playground({active}) {
* useComponentDidMount(() => {
* if (active) {
* console.warning(`Component has mounted.`);
* }
* });
*
* return null;
* }
*/
export declare function useComponentDidMount(callback: () => void): void;