Any tips how to type provided custom hook useArrayRef?
Example: const [refItems, setRefItems] = useArrayRef();
Adding refs:
<div ref={setRefItems} .../>
<div ref={setRefItems} .../>
and finally
[...refItems.current].forEach(function (index) { ... })
gives:
Type error: Property 'current' does not exist on type 'MutableRefObject<any> | ((ref: any) => any)'. Property 'current' does not exist on type '(ref: any) => any'.
Thanks!