UNPKG

903 BTypeScriptView Raw
1import type * as React from 'react';
2export declare const fillRef: <T>(ref: React.Ref<T>, node: T) => void;
3/**
4 * Merge refs into one ref function to support ref passing.
5 */
6export declare const composeRef: <T>(...refs: React.Ref<T>[]) => React.Ref<T>;
7export declare const useComposeRef: <T>(...refs: React.Ref<T>[]) => React.Ref<T>;
8export declare const supportRef: (nodeOrComponent: any) => boolean;
9interface RefAttributes<T> extends React.Attributes {
10 ref: React.Ref<T>;
11}
12export declare const supportNodeRef: <T = any>(node: React.ReactNode) => node is React.ReactElement<any, string | React.JSXElementConstructor<any>> & RefAttributes<T>;
13/**
14 * In React 19. `ref` is not a property from node.
15 * But a property from `props.ref`.
16 * To check if `props.ref` exist or fallback to `ref`.
17 */
18export declare const getNodeRef: <T = any>(node: React.ReactNode) => React.Ref<T> | null;
19export {};