Rethinking MVC with React Native & ReactiveCocoa • Sam Ritchie & Ben Teese • YOW! 2015

Learn how React Native & ReactiveCocoa challenge traditional MVC patterns through virtual DOM, one-way data flow, and functional reactive programming concepts.

Key takeaways
  • React Native uses virtual view hierarchies - lightweight in-memory representations of views instead of directly manipulating native views, making rendering more efficient through diffing

  • One-way data flow is a key concept - data flows down through components via props while events/actions flow up, making state changes more predictable

  • Keep mutable state minimal and localized - state should only exist as high in the component hierarchy as needed, no higher or lower

  • Declarative UI approach - describe UIs in terms of what they should look like given certain inputs, rather than imperatively manipulating views

  • Functional Reactive Programming (FRP) concepts like signals/streams help manage asynchronous events and state changes in a more predictable way

  • Redux/Flux patterns help manage application state by centralizing it and making state changes explicit through actions

  • React’s programming model serves as a “gateway drug” to functional programming techniques in UI development

  • Immutability is emphasized, especially in patterns like Redux where state updates create new state objects rather than mutating existing ones

  • The virtual view hierarchy approach isn’t specific to web/JavaScript - can be applied in native mobile development as shown with React Native

  • Components should be pure functions of their props/state - given the same inputs, they should always render the same output