WhoBuilt

Jamon Holmgren

Oct 14, 2019· 35 min· 3.8K views·Watch on YouTube

Speaker

Jamon Holmgren, co-founder and CTO of Infinite Red, presents his team’s approach to React Native application state at React Native EU 2019, hosted by Callstack.

Why Infinite Red moved beyond Redux

Holmgren traces his team’s path from Flux to Redux, which they used on React Native projects starting in 2015. He cites Redux’s learning curve, boilerplate, side-effect handling, and inconsistent team patterns as reasons they explored other options.

MobX-State-Tree and component updates

Holmgren describes MobX, MobX-React, and MobX-State-Tree as a connected state-management setup. Models define typed data, actions control changes, and asynchronous flows can use MST’s `flow`. Components wrapped in `observer` rerender when the properties they read change.

Combining app state, hooks, and navigation

Holmgren recommends hooks for local component state and React context to access MobX-State-Tree stores. For navigation, he describes keeping screen parameters in a navigation store and using React Navigation’s hooks. He also explains how MST can manage asynchronous permission flows.

Ignite and the React NavX experiment

Holmgren recommends the Ignite Bowser boilerplate, which includes MobX-State-Tree, MobX-React, and React Navigation. He introduces React NavX as an experimental library intended to connect these tools, provide persistence, and remove about 500 lines of glue code. He says the patterns are more established than the new library, which was still broken at the time.

Takeaways

  • Use hooks for state that belongs only to one component, and shared stores for state used across screens.
  • MobX-State-Tree actions make state changes explicit while supporting asynchronous flows with `flow`.
  • With MobX-React observers, components can update based on the store properties they actually use.
  • Treat navigation parameters as application state when screens need to retain them across navigation.
  • Evaluate React NavX as an experiment; Holmgren presents its underlying MobX patterns as more proven than the library itself.

Mentioned in this talk

Search inside this talk

What was claimed 13

Show all 13 facts

Related talks