flâneur — a map of the web's best reading

You Might Not Need an Effect – React

react.dev · 7,125 words · saved by 6 readers

The library for web and native user interfaces

Learn React Escape Hatches Copy page Copy You Might Not Need an Effect Effects are an escape hatch from the React paradigm. They let you “step outside” of React and synchronize your components with some external system like a non-React widget, network, or the browser DOM. If there is no external system involved (for example, if you want to update a component’s state when some props or state change), you shouldn’t need an Effect. Removing unnecessary Effects will make your code easier to follow, faster to run, and less error-prone. You will learn Why and how to remove unnecessary Effects from y

Explore this link on the map →

saved by

related reading