Examples of using React Native for Web with other web tools:
Your application may need to polyfill
[ResizeObserver](https://github.com/que-etc/resize-observer-polyfill) as necessary for your desired browser support.
Recommended starter kits
Expo is a framework and a platform for universal React applications. It is simple to setup, optimizes the web build, and provides dozens of additional cross-platform APIs.
🏃♂️Install and run
expo start --web.
Starting in Expo v33, projects bootstrapped with the Expo CLI will have web support from the start. No need to install yourself unless it's an older project.
To add web support to an existing Expo app you can do the following:
Ensure your project has at least expo@^33.0.0 installed.
Create React App
Create React App is a good way to setup a simple, web-only React app with built-in support for aliasing
Configuring a module bundler
If you have a custom setup, you may choose to configure your module bundler to alias the package to
For example, modify your webpack configuration as follows:
Jest can be configured using the provided preset. This will map
react-native-web and provide appropriate mocks:
Please refer to the Jest documentation for more information.
Node.js can alias
[module-alias](https://www.npmjs.com/package/module-alias). This is useful if you want to pre-render the app (e.g., server-side rendering or build-time rendering).