This is a preview and subject to breaking changes. Do not use this in production yet.
- Install the latest expo-cli
npm i -g expo-cli
- Create new project
expo init AwesomeProject
(select blank project)cd AwesomeProject
- Add dependencies:
- react native web:
yarn add react-native-web react-dom
- (preview) Use the next version of Expo:
yarn add expo@next
- react native web:
- Add
"web"
toplatforms
in theapp.json
:"platforms": [ "android", "ios", + "web" ]
- Start with
expo start
then pressw
- or better
expo start --web --non-interactive
- or better
Extra Credit
This will most likely change
- To use
react-navigation
use:yarn add [email protected]
- Build with
expo build:web
- optionally you can use the
--no-polyfill
flag to get100kb
back
- optionally you can use the
- Customizations to the PWA and
index.html
can be done through theapp.json
. Everything is undocumented at the moment, so check the source code here: @expo/webpack-config{ "expo": { ... "web": { // Add web stuff here. // twitter card example "twitter": { "card": "summary", "title": "Expo Web", "description": "examples of using Expo in the browser", "site": "https://expo.io", "image": "//url-to-image", "creator": "expo bacon" }, // additional meta "metatags": { "author": "anthony kiedis", // meta defaults override "format-detection": "telephone=yes" }, // turn off minify html (default true) "minifyHTML": false } } }