Skip to content
public-library›Rules›React›Lift shared component state into a provider behind an interface

Lift shared component state into a provider behind an interface

When components outside a piece of UI need its state or actions, move that state into a provider component, and expose it through a context with a stable interface, such as state, actions, and meta.

In the full rule