Simple utility function for merging Preact refs.
npm i preact-merge-refs
import { useRef } from 'preact/hooks';
import { mergeRefs } from 'preact-merge-refs'
const refFunc = (node) => {};
export const TestComponent() {
const ref1 = useRef();
const ref2 = useRef();
return (
<div ref={mergeRefs([ref1, ref2, refFunc])} />
);
}
export declare function mergeRefs<T = any>(
refs: Array<Preact.Ref<T>>
): Preact.RefCallback<T>;