I'm trying to understand every line of this beautiful example: https://codesandbox.io/embed/r5qmj8m6lq
Could you please suggest the possible reason to utilise useRef on line 18:
const order = useRef(items.map((_, index) => index))
if it could be replaced by
var order = items.map( (_, index) => index )
(and then of course we have to refer to order
rather than to order.current
)
Thanks a lot!