WhoBuilt

Evan Bacon on Universal React Native Apps, DOM & React Server Components

Jan 2, 2025· 1 h 5 min· 1.6K views·Watch on YouTube

Speakers

Evan Bacon, creator of Expo Router and engineering manager for Expo’s developer tools team, discusses universal React Native apps, DOM components, and React Server Components with host Łukasz Kinski on Callstack’s React Universe On Air.

Universal apps and gradual adoption

Bacon describes Expo as a way to start with web code and add native features as a product grows. DOM components let teams render a component tree in a WebView, while React Server Components help fetch and prepare data. He argues that developers can improve individual components over time instead of rebuilding an entire app.

How DOM components work

The `use dom` directive marks a component for rendering in an embedded WebView, with Metro and Expo’s universal tooling handling the web and native sides. Props go into the component, and callbacks can send events back to the native app with TypeScript support. Bacon recommends a regular WebView for loading a separately deployed website, since it cannot use the same built-in messaging.

Where web and native code fit

Bacon says teams can bring an existing Expo web app to native and then choose which parts to optimize as native components. DOM components can suit content such as Markdown or complex D3 visualizations, while frequently used screens may benefit from native performance. He gives an example of putting a web page inside a DOM component and adding a widget that displays TestFlight review times.

Server Components, caching, and offline use

Expo’s developer preview supports incremental adoption: an existing client app can add server functions and render their results progressively. Bacon explains that data rendered at build time can be embedded in the app, reducing repeated requests and making content available offline. Runtime server functions can still fetch newer data, with loading and error states handled through Suspense and error boundaries.

Deployment and enterprise apps

Expo builds a client bundle for the app and a JavaScript server bundle that can run through `npx expo serve` or a deployment provider. Bacon says Expo Router practices, including file-based routing and error boundaries, are useful preparation for server features. He suggests server-rendered content could let large apps download less-used screens on demand, though he says the preview is not ready for production.

Takeaways

  • Start with the code and skills your team already has, then upgrade individual components as needs become clear.
  • Use DOM components for web experiences that are costly to recreate natively, and consider native code for performance-sensitive screens.
  • Build-time rendering can embed stable content in an app and reduce runtime requests.
  • Server functions can move platform-sensitive or server-dependent work out of a mobile client.
  • Treat Expo’s React Server Components support as a developer preview, and use Expo Router to align with its current direction.

Mentioned in this talk

Search inside this talk

What was claimed 16

Show all 16 facts

Related talks