Some checks failed
Test examples / Test Examples (20) (push) Has been cancelled
Test examples / Test Examples (22) (push) Has been cancelled
Lock Threads / action (push) Has been cancelled
Trigger Release / start (push) Has been cancelled
Stale issue handler / stale (push) Has been cancelled
Update Font Data / create-pull-request (push) Has been cancelled
build-and-deploy / deploy-target (push) Has been cancelled
build-and-deploy / build (push) Has been cancelled
build-and-deploy / stable - aarch64-unknown-linux-musl - node@16 (push) Has been cancelled
build-and-deploy / stable - x86_64-unknown-linux-musl - node@16 (push) Has been cancelled
build-and-deploy / stable - aarch64-unknown-linux-gnu - node@16 (push) Has been cancelled
build-and-deploy / stable - x86_64-unknown-linux-gnu - node@16 (push) Has been cancelled
build-and-deploy / stable - aarch64-pc-windows-msvc - node@16 (push) Has been cancelled
build-and-deploy / stable - x86_64-pc-windows-msvc - node@16 (push) Has been cancelled
build-and-deploy / stable - aarch64-apple-darwin - node@16 (push) Has been cancelled
build-and-deploy / stable - x86_64-apple-darwin - node@16 (push) Has been cancelled
build-and-deploy / build-wasm (nodejs) (push) Has been cancelled
build-and-deploy / build-wasm (web) (push) Has been cancelled
build-and-deploy / Deploy preview tarball (push) Has been cancelled
build-and-deploy / Potentially publish release (push) Has been cancelled
build-and-deploy / publish-turbopack-npm-packages (push) Has been cancelled
build-and-deploy / Deploy examples (push) Has been cancelled
build-and-deploy / thank you, build (push) Has been cancelled
build-and-deploy / Upload Turbopack Bytesize metrics to Datadog (push) Has been cancelled
Rspack Next.js development integration tests / Rspack integration tests (push) Has been cancelled
Rspack Next.js production integration tests / Rspack integration tests (push) Has been cancelled
Turbopack Next.js development integration tests / Next.js integration tests (push) Has been cancelled
Turbopack Next.js production integration tests / Next.js integration tests (push) Has been cancelled
Update Rspack test manifest / Update and upload Rspack development test manifest (push) Has been cancelled
Update Rspack test manifest / Update and upload Rspack production test manifest (push) Has been cancelled
Upload bundler test manifests to areweturboyet.com / Upload test results (push) Has been cancelled
Update React / create-pull-request (push) Has been cancelled
test-e2e-project-reset-cron / reset-test-project (push) Has been cancelled
Notify about the top 15 issues/PRs/feature requests (most reacted) in the last 90 days / run (push) Has been cancelled
4.3 KiB
4.3 KiB
With Expo TypeScript
This is a starter project for creating universal React apps with Next.js, Expo, and TypeScript.
💡 For the most updated info, see the Expo + Next.js Docs!
- Next.js cannot be used for SSR in your native app.
- The native bundle is built using the Metro bundler and may not have the same level of optimization as the web bundle which is compiled using the Next.js Webpack configuration.
- Expo transpiles
react-native-webpackages by default to enable the use ofreact-nativein a browser or Node.js environment. - All Expo packages work in the browser. If you experience issues using them in a Node environment, please report them here: Expo issues.
- Most community
react-native-*packages do not support web, please refer to reactnative.directory for a list of web compatible packages. - Eject the
pages/_documentcomponent by runningyarn next-expo customize. - To use fonts and images, see the Expo docs.
Deploy your own
Deploy the example using Vercel (web only):
Deploy the native app to the App store and Play store using Expo deployment.
How to use
Execute create-next-app with npm, Yarn, or pnpm to bootstrap the example:
npx create-next-app --example with-expo-typescript with-expo-typescript-app
yarn create next-app --example with-expo-typescript with-expo-typescript-app
pnpm create next-app --example with-expo-typescript with-expo-typescript-app
Running web
🚨 Using default Expo web with Next.js is not supported.
- Start the Next.js project with
yarn dev(yarn next dev).
Deploy the web app to the cloud with Vercel (Documentation).
Running native
- Install the Expo CLI
npm i -g expo-cli. - Start the Metro bundler with
yarn iosoryarn android-- This runsexpo startwith the Expo CLI. - You can run the mobile app using the Expo client app, or by running
yarn ejectand building the project manually (this requires a macbook for iOS).
Deploy the native app to the App store and Play store using Expo deployment.
Troubleshooting
You may find that certain packages like @ui-kitten/components do not work in the browser. This is because they need to be transpiled by Next.js, you can fix this by doing the following:
- Install the following:
yarn add -D next-compose-plugins next-transpile-modules
- Modify the Next.js config
next.config.js:
const { withExpo } = require("@expo/next-adapter");
const withPlugins = require("next-compose-plugins");
const withTM = require("next-transpile-modules")([
// Add the name of your package here...
"@ui-kitten/components",
]);
module.exports = withPlugins([withTM, [withExpo, { projectRoot: __dirname }]], {
// ...
});
