Awaiting A Reaction

This title could be clearer and more informative.Try out Clickbait Shieldfor free (5 uses left this month).

A React code snippet submitted anonymously to The Daily WTF shows useState arrays being mutated directly with splice and push, with those synchronous array methods incorrectly awaited. Despite being fundamentally wrong — bypassing React's immutable state update pattern — the code somehow works, and attempts to refactor it break

2m read time From thedailywtf.com
Post cover image

Sort: