Track a collection of DOM elements in the exact order they're rendered in the DOM and watch the DOM for any change to their order.
npm install ariakit
Learn more in Getting started.
useCollectionState() <Collection> <CollectionItem /> </Collection>