@twilio-paste/paste-reakit-fork
Version:
Forked Reakit that addresses SSR hydration issues
12 lines (10 loc) • 359 B
text/typescript
import { Item } from "./types";
import { isElementPreceding } from "./isElementPreceding";
export function findDOMIndex(items: Item[], item: Item) {
return items.findIndex((currentItem) => {
if (!currentItem.ref.current || !item.ref.current) {
return false;
}
return isElementPreceding(item.ref.current, currentItem.ref.current);
});
}