Skip to content
public-library›Rules›React›Avoid unnecessary Effects

Avoid unnecessary Effects

Use an Effect only to synchronize with a system outside React, such as a subscription, a timer, a network connection, or an imperative widget. Compute derived values during render, and run logic caused by a user action in that action's event handler.

In the full rule