Skip to content
public-library›Rules›React›Subscribe to and depend on only the values you use

Subscribe to and depend on only the values you use

Subscribe to the narrowest value a component renders, and give Effects the narrowest dependencies they read. When a value is needed only inside an event handler, read it there instead of subscribing to it.

In the full rule