Five years of React Native at Shopify

Mustafa Ali
10 min readadvanced
--
View Original

Overview

The article discusses Shopify's five-year journey with React Native, highlighting the reasons for its adoption, the successes achieved, and the lessons learned. It emphasizes the performance improvements, developer productivity, and the importance of native expertise alongside React Native.

What You'll Learn

1

How to leverage React Native for cross-platform mobile development

2

Why performance optimization is crucial in React Native applications

3

When to integrate native code within a React Native app

Prerequisites & Requirements

  • Familiarity with mobile app development concepts
  • Experience with JavaScript and React

Key Questions Answered

What are the main reasons Shopify adopted React Native?
Shopify adopted React Native for three main reasons: to avoid building the same features twice for iOS and Android, to enable developers to work across platforms, and to focus on delivering value to users rather than maintaining feature parity. This strategic decision has significantly improved productivity and allowed for faster feature delivery.
How has performance improved in Shopify's React Native apps?
Shopify's React Native apps have achieved sub-500ms screen loads and over 99.9% crash-free sessions, demonstrating that with proper patterns and techniques, React Native can deliver performance comparable to native applications. This improvement is attributed to extensive prototyping and ongoing optimizations.
What role does TypeScript play in React Native development?
TypeScript has become essential at Shopify, facilitating smoother transitions for developers between React web and React Native. It enhances talent portability, allowing engineers to work across platforms more effectively, which increases staffing flexibility and speeds up development.
What are the challenges of debugging in React Native?
Debugging in React Native can be flaky and requires significant configuration in development environments like VSCode. Unlike native development, which offers robust debugging tools, React Native's debugging capabilities have been a pain point, although improvements are being made.

Key Statistics & Figures

Screen load time
sub-500ms
Achieved in the Shopify app, demonstrating significant performance optimization.
Crash-free sessions
>99.9%
Indicates high stability and reliability of the React Native applications.

Technologies & Tools

Some links below are affiliate links. We may earn a commission if you make a purchase.

Key Actionable Insights

1
Invest in training native developers in React Native to enhance team capability.
By providing training and support for native developers transitioning to React Native, teams can leverage existing expertise to improve app performance and development speed.
2
Utilize shared libraries to avoid reinventing the wheel across teams.
Creating shared components allows teams to benefit from collective knowledge and reduces duplicated efforts, ultimately leading to more efficient development processes.
3
Adopt a hybrid approach using both React Native and native code for optimal performance.
By recognizing that not all features are best built in React Native, teams can strategically use native code where it excels, ensuring high performance and user experience.

Common Pitfalls

1
Neglecting the importance of native expertise can lead to performance issues.
Without experienced native developers, teams may struggle with optimizing app performance and managing platform-specific challenges.
2
Over-reliance on third-party libraries can introduce risks.
Using numerous third-party libraries increases maintenance overhead and the potential for supply chain attacks, necessitating diligent management and updates.