Fetch Once, Render Everywhere: React Server Components in Expo Router

This ad is not shown to multipass and full ticket holders
JSNation US
JSNation US 2026
November 16 - 19, 2026
New York, US & Online
Upcoming event
JSNation US 2026
JSNation US 2026
November 16 - 19, 2026. New York, US & Online
Bookmark
Rate this content
Sentry
Promoted
Code breaks, fix it faster

Crashes, slowdowns, regressions in prod. Seer by Sentry unifies traces, replays, errors, profiles to find root causes fast.

Get started

We’ve been hard at work to create a first-look at data fetching, server rendering, and streaming in universal Expo Router apps.

This talk has been presented at React Summit 2024, check out the latest edition of this React Conference.

FAQ

React Native is a framework for building native applications using JavaScript and React. It allows developers to create apps that run on both iOS and Android platforms using the same codebase.

Evan Bacon is an engineer and the creator of ExpoRouter, a file-based routing mechanism for building React apps that run on both web and native platforms from the same codebase.

ExpoRouter is a file-based routing mechanism for building React apps that run on both web and native platforms from the same codebase. It uses familiar web APIs like link and href and supports nested routing for organizing routes.

ExpoRouter simplifies the integration of AI by enabling server-driven UI and streaming server-rendered content. This makes it easier to build high-powered AI native apps that can interact with server-side logic in real-time.

Server-driven UI enables dynamic rendering based on various criteria such as user type, location, and more. It allows for A/B testing and high variation in UI, leading to better performance and user experience.

The source code for ExpoRouter is being actively developed and merged into the Expo repo. Developers can follow the progress on GitHub and will be able to access it once it is officially released.

ExpoRouter complies with app store policies by not sending any native code dynamically. It adheres to guidelines that prevent changing the approved content and behavior of an app, ensuring that all features are pre-approved.

ExpoRouter supports iOS, Android, web, and other platforms through its universal file-based routing system. It provides a seamless experience across different devices and operating systems.

ExpoRouter improves developer experience by simplifying the creation of server-driven UIs, reducing the need for client-side data fetching, and enabling rapid development with a unified codebase for web and native apps.

React Server Components are a cutting-edge approach to server rendering, allowing for the seamless integration of server and client code. They enable dynamic, server-driven UIs and reduce the need for client-side data fetching.

Evan Bacon
Evan Bacon
28 min
14 Jun, 2024

Comments

Sign in or register to post your comment.
  • Manos Hatziefstratiou
    Manos Hatziefstratiou
    Expo router looks really good. I start working with it in some new projects and FTW!
Video Summary and Transcription
ExpoRouter is a file-based routing system that enhances the development of React apps for both web and native platforms. It supports server-driven UI, enabling dynamic rendering and reducing the need for client-side data fetching. This approach is beneficial for developers aiming to build high-performance applications with smooth native interactions. Expo server components, expo server side rendering, and expo react server components are pivotal in this process, allowing for seamless integration of server and client code. The video also delves into the use of expo router server components and expo router ssr, which facilitate the creation of server-driven UIs across platforms. By leveraging these tools, developers can efficiently manage network requests and optimize app performance, offering a unified development experience. The introduction of React Server Components within ExpoRouter further streamlines the process, allowing for the creation of advanced AI-powered native apps that can dynamically render content and handle complex features.

1. Overview of React Native and exporouter

Short description:

React Native has grown to become the most impactful way to build client-side applications. I'm Evan Bacon, an engineer and the creator of exporouter. It's the first file-based routing mechanism for building React apps that run on both web and native platforms from the same code base. It uses familiar web APIs like link and href to move between routes, and it's also a nested routing system. Expo provides universal solutions to most aspects of app development. Data fetching and server rendering bring interesting opportunities.

When React Native was first announced nearly 10 years ago, it had a very simple premise, which was web the good parts. From this basic concept, React Native has grown to become the most impactful way to build client-side applications. If you fast-forward to now, React Native powers hundreds of the most-used apps in the app store trending list every single day. Really no signs of slowing down. So where do we go from here?

I'm Evan Bacon, an engineer and the creator of exporouter. It's the first file-based routing mechanism for building React apps that run on both web and native platforms from the same code base. It feels like magic. By simply creating files in the app directory, exporouter instantly creates robust navigation for both your native app and your website. It uses familiar web APIs like link and href to move between routes, and it's also a nested routing system, enabling you to organize routes into folders to establish shared UI like tab bars, headers, drawers, so on and so forth. And it's also a... It also has day-one support for the new React compiler, thanks to our collaboration with the meta team. This means you no longer need to write use memo or use callback in your apps, leading to a much better experience for both users and developers. We'll be installing compiler by default in the next version of Expo CLI, so you can flip it on and off. It's actually pretty sweet, because you can turn it off without having to restart the dev server. Really slick. There are many aspects to app development, and Expo provides universal solutions to most of them. But all of these solutions are primarily targeted at building client-side applications. And there's only so much that you can do with the client on its own. Things get really interesting when you bring in data fetching and server rendering.

2. Server-Driven UI and React Server Components

Short description:

Most native apps operate like single-page websites, resulting in slower performance and limited networking. Popular apps utilize server-driven UI for A-B testing and dynamic rendering. However, indie developers often face challenges due to the lack of accessible frameworks. ExpoRouter aims to address this by introducing React server components, enabling powerful server-driven UI for all platforms. The progress in implementing React server components is exciting, showcasing the potential of modern rendering techniques. With ExpoRouter, building high-powered AI native apps becomes easier, utilizing streaming and server rendering capabilities.

From a data perspective, most native apps operate essentially like single-page websites. Which is old now data. This means slower performance and substantially less networking. Popular native apps such as Lyft and Netflix, Reddit, and many others use some form of server-driven UI in their applications. But it's very complicated to configure, and as a result, it's out of reach for most app developers.

They do this so they can A-B test functionality and render UI with a high degree of variation based on all sorts of criteria, such as user type, location, the currency you use, the temperature in your region, lots of different things. The approaches vary in many small ways, but they do share some common architecture, such as using JSON as a static UI representation. Think of this JSON as HTML, but for custom native runtimes. And we can see a pattern here from the amount of apps that use all these very similar systems. And that is that server-driven UI is an important system for building apps, but it's just not very accessible to indie developers. All these groups have these frameworks. They are not open source.

So it got me to thinking. What if we could make server-driven UI available to everyone? But also the most powerful version of it ever imagined. And that is the goal of ExpoRouter. Now, to do this, we're bringing React server components, the most cutting-edge approach to server rendering to all platforms, iOS, Android Web, and anything else, through ExpoRouter. This is a huge undertaking. This will require refinement in many different libraries across the universal ecosystem. Our official implementation of React server components for universal apps is currently in early development. But it's worth sharing, because the progress is really exciting. And frankly, it's pretty inspiring to see what apps are capable of when they use modern rendering techniques from the web.

Now, there's a lot to RSE, such as server actions, concurrent routing, flights, et cetera. But I figured it would be easier to just show you guys a demo of what's possible. So I've been really interested in AI, as has everyone. But it's historically been very hard to build high-powered AI native apps. And this is because streaming and server rendering are both critical aspects of working with an LLM. But with React server components and ExpoRouter, it's actually really, really easy to work with AI. So here I have a chat GPT-like app which pings OpenAI with a React server action and streams in native text from the server. So think of this as a chat GPT-style app, right? Everything that returns back from the server is server rendered, though. Or at least partially server rendered, because we also have client components.

QnA

Check out more articles and videos

We constantly think of articles and videos that might spark Git people interest / skill us up or help building a stellar career

Simplifying Server Components
React Advanced 2023React Advanced 2023
27 min
Simplifying Server Components
Top Content
React server components simplify server-side rendering and provide a mental model of components as pure functions. Using React as a library for server components allows for building a basic RSC server and connecting it to an SSR server. RSC responses are serialized virtual DOM that offload code from the client and handle interactivity. The client manifest maps serialized placeholders to real components on the client, enabling dynamic rendering. Server components combine the best of classic web development and progressive enhancement, offering the advantage of moving logic from the client to the server.
Exploring React Server Component Fundamentals
React Day Berlin 2023React Day Berlin 2023
21 min
Exploring React Server Component Fundamentals
Top Content
This Talk introduces React Server Components (RSC) and explores their serialization process. It compares RSC to traditional server-side rendering (SSR) and explains how RSC handles promises and integrates client components. The Talk also discusses the RSC manifest and deserialization process. The speaker then introduces the Waku framework, which supports bundling, server, routing, and SSR. The future plans for Waku include integration with client state management libraries.
And Now You Understand React Server Components
React Summit 2024React Summit 2024
27 min
And Now You Understand React Server Components
Top Content
In this Talk, Kent C. Dodds introduces React Server Components (RSCs) and demonstrates how to build them from scratch. He explains the process of integrating RSCs with the UI, switching to RSC and streaming for improved performance, and the benefits of using RSCs with async components. Dodds also discusses enhancements with streaming and server context, client support and loaders, server component rendering and module resolution, handling UI updates and rendering, handling back buttons and caching, and concludes with further resources for diving deeper into the topic.
A Practical Guide for Migrating to Server Components
React Advanced 2023React Advanced 2023
28 min
A Practical Guide for Migrating to Server Components
Top Content
React query version five is live and we'll be discussing the migration process to server components using Next.js and React Query. The process involves planning, preparing, and setting up server components, migrating pages, adding layouts, and moving components to the server. We'll also explore the benefits of server components such as reducing JavaScript shipping, enabling powerful caching, and leveraging the features of the app router. Additionally, we'll cover topics like handling authentication, rendering in server components, and the impact on server load and costs.
Server Components: The Epic Tale of Rendering UX
React Summit 2023React Summit 2023
26 min
Server Components: The Epic Tale of Rendering UX
Top Content
This Talk introduces server components in React, which provide an intermediate format for rendering and offer advantages for both client-side and server-side rendering. Server components reduce bundle size on the client and improve search engine optimization. They abstract the rendering process, allowing for faster rendering and flexibility in choosing where to render components. While server components are still in the experimental stage, Next.js is a good starting point to try them out.
RSCs In Production: 1 Year Later
React Summit 2024React Summit 2024
24 min
RSCs In Production: 1 Year Later
Top Content
This Talk explores the experience of shipping server components in production and highlights the benefits and challenges of using Server Components in Next.js apps. The Talk discusses the deployment of UploadThing and the use of AppRouter for safe production usage. It delves into the implementation of different layouts, data fetching, and code centralization for improved performance. The Talk also covers the use of server components for performance optimization and latency handling. Additionally, it explores the use of Edge and Lambda for partial pre-rendering and the challenges faced with webpack performance and hydration. Overall, the Talk emphasizes the benefits and challenges of working with Server Components in Next.js applications.

Workshops on related topic

Introducing FlashList: Let's build a performant React Native list all together
React Advanced 2022React Advanced 2022
81 min
Introducing FlashList: Let's build a performant React Native list all together
Top Content
Featured Workshop
David Cortés Fulla
Marek Fořt
Talha Naqvi
3 authors
In this workshop you’ll learn why we created FlashList at Shopify and how you can use it in your code today. We will show you how to take a list that is not performant in FlatList and make it performant using FlashList with minimum effort. We will use tools like Flipper, our own benchmarking code, and teach you how the FlashList API can cover more complex use cases and still keep a top-notch performance.You will know:- Quick presentation about what FlashList, why we built, etc.- Migrating from FlatList to FlashList- Teaching how to write a performant list- Utilizing the tools provided by FlashList library (mainly the useBenchmark hook)- Using the Flipper plugins (flame graph, our lists profiler, UI & JS FPS profiler, etc.)- Optimizing performance of FlashList by using more advanced props like `getType`- 5-6 sample tasks where we’ll uncover and fix issues together- Q&A with Shopify team
Mastering React Server Components and Server Actions in React 19
React Summit US 2024React Summit US 2024
150 min
Mastering React Server Components and Server Actions in React 19
Featured Workshop
Maurice de Beijer
Maurice de Beijer
Calling all React developers! Join us for an immersive 4-hour workshop diving deep into React Server Components and Server Actions. Discover how these game-changing technologies are revolutionizing web development and learn how to harness their full potential to build lightning-fast, efficient applications.

Explore the world of React Server Components, seamlessly blending server-side rendering with client-side interactivity for unmatched performance and user experience. Dive into React Server Actions to see how they combine client-side interactivity with server-side logic, making it easier to develop interactive applications without traditional API constraints.

Get hands-on experience with practical exercises, real-world examples, and expert guidance on implementing these technologies into your projects. Learn essential topics such as the differences between Server and Client Components, optimizing data fetching, passing data effectively, and maximizing performance with new React hooks like useActionState, useFormStatus and useOptimistic.

Whether you're new to React or a seasoned pro, this workshop will equip you with the knowledge and tools to elevate your web development skills. Stay ahead of the curve and master the cutting-edge technology of React 19. Don't miss out - sign up now and unleash the full power of React!
Exploring Server Side Rendering
React Advanced 2025React Advanced 2025
179 min
Exploring Server Side Rendering
Featured Workshop
Krasimir Tsonev
Krasimir Tsonev
Server-side rendering (SSR) is back in the spotlight – and React is evolving fast. In this workshop, we’ll go deep into the mechanics, performance trade-offs, and modern techniques of SSR with React.js. You'll start by building an SSR app from scratch – no frameworks, just raw renderToString and hydrateRoot—to truly understand how React renders on the server and hydrates on the client. From there, we'll upgrade to React 18’s streaming capabilities using renderToPipeableStream, implement selective hydration using Suspense, and integrate data fetching directly into the server render cycle. We’ll look at React Server Components (RSC), showing how they complement SSR. We'll also cover hydration strategies, how to prevent mismatches, and how to cache or stream HTML effectively for real-world performance. Finally, we’ll bridge our manual SSR work into production frameworks like Next.js.
Detox 101: How to write stable end-to-end tests for your React Native application
React Summit 2022React Summit 2022
117 min
Detox 101: How to write stable end-to-end tests for your React Native application
Top Content
Workshop
Yevheniia Hlovatska
Yevheniia Hlovatska
Compared to unit testing, end-to-end testing aims to interact with your application just like a real user. And as we all know it can be pretty challenging. Especially when we talk about Mobile applications.
Tests rely on many conditions and are considered to be slow and flaky. On the other hand - end-to-end tests can give the greatest confidence that your app is working. And if done right - can become an amazing tool for boosting developer velocity.
Detox is a gray-box end-to-end testing framework for mobile apps. Developed by Wix to solve the problem of slowness and flakiness and used by React Native itself as its E2E testing tool.
Join me on this workshop to learn how to make your mobile end-to-end tests with Detox rock.
Prerequisites- iOS/Android: MacOS Catalina or newer- Android only: Linux- Install before the workshop
Next.js 13: Data Fetching Strategies
React Day Berlin 2022React Day Berlin 2022
53 min
Next.js 13: Data Fetching Strategies
Top Content
Workshop
Alice De Mauro
Alice De Mauro
- Introduction- Prerequisites for the workshop- Fetching strategies: fundamentals- Fetching strategies – hands-on: fetch API, cache (static VS dynamic), revalidate, suspense (parallel data fetching)- Test your build and serve it on Vercel- Future: Server components VS Client components- Workshop easter egg (unrelated to the topic, calling out accessibility)- Wrapping up
The Gateway to Backend: A Frontend Developer's Guide to Full-Stack Development
React Summit US 2023React Summit US 2023
160 min
The Gateway to Backend: A Frontend Developer's Guide to Full-Stack Development
Top Content
WorkshopFree
Amy Dutton
Amy Dutton
This workshop will guide you through the product development life cycle of creating a real-world web application. You will learn about React Server Components, building a design system within Storybook, and using frontend development to approach becoming a full-stack developer. The workshop will cover increasing confidence in your application with unit tests and implementing authentication and authorization. You'll have the opportunity to work through product features and examine a real-world RedwoodJS project, gaining valuable experience in real-world product development. RedwoodJS makes it simple to approach full-stack development, and this workshop will give you the skills you need to create your own real-world web applications.