@preact-hooks/instance
Version:
A custom Preact Hook that provides a sensible alternative to useRef for storing instance variables.
9 lines (6 loc) • 330 B
TypeScript
// Type definitions for Preact Hooks - Instance
// Project: https://github.com/mihar-22/preact-hooks-instance
// Definitions by: Rahim Alwer <https://github.com/mihar-22>
declare function useInstance<T>(value: T): T extends (...args: any) => any ? ReturnType<T> : T;
export as namespace useInstance;
export default useInstance;