Skip to content

About

Use React DOM inside React Native without Expo

Resources

Contributing

Stars

3 stars

Watchers

0 watching

Forks

Latest commit

 

History

96 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-native-use-dom

E2E · Tested React Native versions

Render React DOM components inside React Native with the 'use dom' directive, without Expo.

A module marked 'use dom' runs in a native web view on iOS and Android, and native code renders it like any other component: props go in, function props become native actions the component can await, and methods it exposes are reachable through a ref. Release builds embed every page, so components load offline.

Calling a DOM component: native actions, a ref reset, and a prop update     Fast Refresh updates a DOM component in place and keeps its state

Function props, ref methods and props cross the bridge in both directions · Fast Refresh keeps the component's state

Repository

Path What it holds
packages/react-native-use-dom the library: Babel plugin, Metro integration, runtimes, native view
examples/bare-0.87 a React Native Community CLI app, without Expo
examples/expo-57 an Expo app with a development build
examples/bare-* the same app on the other React Native versions the tests cover
docs the user guide

Develop

From a clean checkout, with Node.js 22.12 or newer:

corepack enable          # provides the pnpm version in package.json's packageManager
pnpm install
pnpm exec lefthook install
pnpm build

Run the checks CI runs. zizmor audits the workflows:

pnpm lint
pnpm format:check
pnpm typecheck
pnpm test
zizmor .github

The tests need no simulator or device: they run Metro, Babel and both runtimes in-process.

Run the example apps on a simulator or device, which needs the React Native environment for each platform. Each README has the steps, for development and release builds:

The examples use the library from the workspace, through its build: run pnpm build again after changing it.

CONTRIBUTING.md covers the git hooks, commit messages, type tests and generated docs.

License

MIT

About

Use React DOM inside React Native without Expo

Resources

Contributing

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages