1. React
  2. React Rally
  3. 2017
  4. Demystifying setState()

Demystifying setState()

Justice Mba at React Rally 2017

Many React developers bump into bugs because of using setState() incorrectly. In fact, some dreadfully avoid setState(). In particular, its asynchronous nature and batching often confuse React developers. In this talk, I will explore common setState() misunderstandings and pitfalls, explain why exactly setState() needs to be asynchronous, how to use it correctly, the powerful patterns buried in setState(), and what it means for the future of React in Fiber.