HomeGuidesReferenceLearn
ArchiveExpo SnackDiscord and ForumsNewsletter

Develop websites with Expo

Learn how to develop your app for the web so you can build a universal app.


Expo has first-class support for building full-stack websites with React. Expo websites can be statically rendered for SEO and performance, or client-rendered for a more app-like experience in the browser.

Render text on any platform with the <Text> component from React Native for web.

app/index.js
import { Text } from 'react-native';

export default function Page() {
  return <Text>Home page</Text>;
}

React Native for web (RNW) is a set of component libraries such as <View>, and <Text>, that wrap react-dom primitives such as <div>, <p>, and <img>. RNW is optional when developing for web since you can use React DOM directly, but we often recommended it when building across platforms as it maximizes code reuse.

Alternatively, you can write web-only React DOM components such as <div>, <p>, and so on, however, these components won't render on native platforms.

app/index.js
export default function Page() {
  return <p>Home page</p>;
}

Building web-only components is fully supported by Expo, however, you may want to organize your code to better support building for both web and native platforms simultaneously. Learn more in platform-specific modules.

All of the libraries in the Expo SDK are built to support both browser and server rendering environments (when applicable). Libraries are also optimized for the individual platforms they target.

Development features like Fast Refresh, debugging, environment variables, and bundling are also fully universal, enabling a unified developer experience. Expo CLI automatically optimizes code for individual platforms when you build for production, using techniques like platform shaking.

Getting started

Install web dependencies

Terminal
npx expo install react-dom react-native-web @expo/metro-runtime
Not using the expo package in your app yet?

If you haven't added Expo to your React Native app yet, you can either install Expo modules (recommended) or just install the expo package and configure the app entry file. This will allow you to target web, but it will not include support for the Expo SDK.

  1. Install Expo CLI in your project:
Terminal
npm install expo
  1. Modify the entry file to use registerRootComponent instead of AppRegistry.registerComponent:
+ import {registerRootComponent} from 'expo';

import App from './App';
- import {AppRegistry} from 'react-native';
- import {name as appName} from './app.json';

- AppRegistry.registerComponent(appName, () => App);
+ registerRootComponent(App);

Start the dev server

You can now start the dev server and develop in the browser with:

Terminal
npx expo start --web

The app can be exported as a production website with:

Terminal
npx expo export --platform web

File-based routing

Build routes and navigation with Expo Router.

Static rendering and SEO

Render your website as static HTML with Expo Router to improve SEO and performance.

Publish websites

Export your website and upload to any web host.

Customizing the JavaScript bundler

Customize Metro bundler for your project.