Skip to content
public-library›Rules›React›Keep components and Hooks pure

Keep components and Hooks pure

Make component and Hook render logic pure: given the same props, state, and context, return the same result without observable side effects. Put side effects in event handlers, Effects, or framework data-loading APIs.

In the full rule