Using Next.js with Expo will enable you to server side render the web part of your Expo app. This demo shows you how to setup your universal application to use use advanced universal modules from the Expo SDK like Camera, Gestures, Permissions, etc... with the Next.js tool-chain!
🚨 SSR is an experimental feature with Expo so modules might not be fully optimized for Next.js. If you find bugs please report them on the Expo repo or expo-cli repo with the
[nextjs]
tag in the title.
For the most updated guide you should refer to the Expo docs: Using Next.js. Here are the latest docs on master.
In this approach you would be using SSR for web in your universal project. This is the recommended path because it gives you full access to the features of Expo and Next.js.
npm i -g expo-cli
expo init --template blank
cd
into the projectyarn add @expo/next-adapter
npm i --save @expo/next-adapter
yarn next-expo
--customize or -c
--force or -f
yarn next dev
http://localhost:3000/
to see your project!Starting web
expo start:web
yarn next dev
Building web
expo build:web
yarn next build