Promptles
React & Frontend

Side Effect

intermediate

Definition

Anything an app does that reaches outside its own neat little world: saving to a database, fetching a file from the internet, changing the page title, starting a timer. Side effects need to be handled carefully because the outside world is unpredictable.

In the wild

A weather app shows your local forecast. The act of going to the internet to fetch the latest temperature is a side effect: it's the app reaching out to the world. Updating the browser tab to read 'Sunny, 22°' is another side effect.

More from React & Frontend