@blueprintjs/core
Version:
Core styles & components
16 lines (15 loc) • 623 B
TypeScript
import * as React from "react";
/**
* Custom hook for validating component props during development.
* This hook runs validation checks only in non-production environments,
* following the same pattern as AbstractComponent.
*
* @param validator - Function that performs the validation checks
* @param dependencies - Optional array of dependencies that trigger validation when changed
*
* @example
* useValidateProps(() => {
* if (value < 0) console.warn("Value must be positive");
* }, [value]);
*/
export declare function useValidateProps(validator: () => void, dependencies?: React.DependencyList): void;