Skip to main content

React Native, as a real web app.

A standalone web runtime for React Native apps. You write react-native. The browser gets semantic HTML, atomic CSS, server rendering, and SEO tags.

  • React 19
  • TypeScript
  • ESM only
  • MIT
App.tsxYou write
<View role="main" style={{ padding: 16 }}>
  <Text role="heading" aria-level={1}>
    Hello from React Native
  </Text>
  <Text href="/about">About</Text>
</View>
index.htmlThe browser gets
<style data-precedence="rootnative-reset">…</style>
<style data-precedence="rootnative-shorthand">.rn-hst5or{padding:16px}</style>
<main class="rn-view rn-hst5or">
  <h1 class="rn-text">Hello from React Native</h1>
  <a href="/about" class="rn-text">About</a>
</main>
How it works

One import. Three layers.

Your app imports react-native. On Metro, @rootnative/web-expo or @rootnative/web-metro resolves that name to @rootnative/web. On Vite, the plugin does it. Import the web entry only in code that runs on the web. A server render needs nothing from this package.

01

Parity

@rootnative/web

The React Native components and APIs.

02

Web

@rootnative/web/dom

Browser features that native doesn't have, for example <Head>.

03

Server

react-dom/server

React's own renderer. Each component sends its CSS with its HTML.

Set up

Point react-native at the package.

In an Expo app or a React Native CLI app, wrap your Metro config with withRootNative. In a Vite app, add the Vite plugin. The rest of your app stays the same code that runs on iOS and Android.

Read the installation guide
metro.config.js
const { getDefaultConfig } = require('expo/metro-config')
const { withRootNative } =
  require('@rootnative/web-expo/metro.cjs')

module.exports = withRootNative(getDefaultConfig(__dirname))

Your React Native code, in the browser.

The Status page lists what ships today and what's planned.