UNPKG

@appbuckets/react-ui-core

Version:

Core utilities built for AppBuckets React UI Framework

25 lines (24 loc) 625 B
import * as React from 'react'; /** * A function to correctly handles passing refs. * * @param ref The ref Object or Function * @param node The node that should by passed by ref */ export declare function handleRef<E>( ref: | React.MutableRefObject<E | null> | ((instance: E | null) => void) | null | undefined, node: E | null ): void; export declare function toRefObject<E extends HTMLElement>(node: E | null): any; /** * Check if a thing is a valid React Ref Object * * @param ref Thing to Check */ export declare function isRefObject<E = HTMLElement>( ref: any ): ref is React.RefObject<E>;