Knowledgebase

React Native Navigation and State Print

  • mobiledevelopment, mobile, woocommerce, restore, caching, errors, guide, howto
  • 0

Application structure.

WHAT NAVIGATION REQUIRES

A library, since it is not built in.

WHAT TO CHOOSE

The widely used option, unless you have a reason otherwise.

WHAT NAVIGATION PATTERNS EXIST

Stacks, tabs, drawers, and modals.

WHAT TO ENSURE

The platform back gesture and button behave correctly Deep links reach the right screen with a sensible history State survives backgrounding

WHAT STATE MANAGEMENT TO USE

The same considerations as any React application.

WHAT DIFFERS ON MOBILE

State must survive backgrounding and possible termination Persistence matters more, since sessions are interrupted

WHAT TO PERSIST

Enough to restore the user's position and unsaved input.

WHAT TO KEEP LOCAL

Transient interface state.

WHAT TO AVOID

Putting everything in a global store Storing server data as owned state

WHAT TO USE FOR SERVER DATA

A data-fetching library handling caching, retries and staleness.

WHY

Mobile connections are intermittent, and retry behaviour matters more than on the web.

WHAT TO HANDLE EXPLICITLY

Being offline, which is a normal condition rather than an error.


Was this answer helpful?
Back

Are you happy with your experience? Leave us a review on Trustpilot.


Trustpilot