Skip to content
public-library›Rules›React›Use Activity to hide UI that should keep its state

Use Activity to hide UI that should keep its state

When UI toggles between visible and hidden and should keep its state while hidden, wrap it in <Activity mode={visible ? 'visible' : 'hidden'}> instead of unmounting it.

In the full rule