You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Dear friends!
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 toorder.current
)Thanks a lot!
Beta Was this translation helpful? Give feedback.
All reactions