Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ typings
node_modules
example/android-bundle.js
example/ios-bundle.js
example-web/dist
example-web/.expo
3 changes: 2 additions & 1 deletion .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
**/*.macos.js
**/*.windows.js

; The example app has its own dependencies
; The example apps have their own dependencies
example/**
example-web/**

**/node_modules/resolve/test/**

Expand Down
17 changes: 16 additions & 1 deletion .github/workflows/example.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Example apps
# Builds the example app on Android and iOS. Kept separate from `Build` so that
# Builds the example app on Android, iOS and web. Kept separate from `Build` so that
# Release (release.yml), which waits for `Build`, is not blocked by the example
# app's native toolchain.
on:
Expand Down Expand Up @@ -47,3 +47,18 @@ jobs:
run: cd example && pnpm build:ios
- name: Pod install
run: cd example && pod install --project-directory=ios
web:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: pnpm/action-setup@v4
with:
version: 10
- uses: actions/setup-node@v5
with:
node-version: 22
cache: pnpm
- name: Install Dependencies
run: pnpm install --frozen-lockfile
- name: Export web example
run: cd example-web && pnpm export
2 changes: 2 additions & 0 deletions example-web/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dist/
.expo/
11 changes: 11 additions & 0 deletions example-web/app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"expo": {
"name": "SegmentedControlExample",
"slug": "segmented-control-example",
"platforms": ["web"],
"web": {
"bundler": "metro",
"output": "single"
}
}
}
6 changes: 6 additions & 0 deletions example-web/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = function (api) {
api.cache(true);
return {
presets: ['babel-preset-expo'],
};
};
6 changes: 6 additions & 0 deletions example-web/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import {registerRootComponent} from 'expo';

// Shares the example app with the Android/iOS example in ../example.
import App from '../example/App';

registerRootComponent(App);
18 changes: 18 additions & 0 deletions example-web/metro.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
const path = require('path');
const {getDefaultConfig} = require('expo/metro-config');

const projectRoot = __dirname;
// The library itself lives at the repository root, and the app code is
// shared with ../example. Watch the root and resolve the library from it.
const repoRoot = path.resolve(projectRoot, '..');
const libraryName = require('../package.json').name;

const config = getDefaultConfig(projectRoot);

config.watchFolders = [repoRoot];
config.resolver.extraNodeModules = {
...config.resolver.extraNodeModules,
[libraryName]: repoRoot,
};

module.exports = config;
18 changes: 18 additions & 0 deletions example-web/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "SegmentedControlExampleWeb",
"version": "0.0.1",
"private": true,
"main": "index.js",
"scripts": {
"start": "expo start --web",
"export": "expo export --platform web"
},
"dependencies": {
"@expo/metro-runtime": "~58.0.17",
"expo": "~58.0.26",
"react": "19.3.0",
"react-dom": "19.3.0",
"react-native": "0.88.1",
"react-native-web": "~0.21.4"
}
}
1 change: 1 addition & 0 deletions example/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
.watchman-*
.xcode.env
android/app/
android/.kotlin/
android/build/
dist/*
!dist/.gitignore
Expand Down
1 change: 0 additions & 1 deletion example/ios/.xcode.env

This file was deleted.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"test": "pnpm flow && pnpm lint",
"ios": "cd example && react-native run-ios",
"android": "react-native run-android",
"web": "pnpm --filter SegmentedControlExampleWeb start",
"flow": "flow",
"lint": "eslint . --cache",
"tsc": "tsc --noEmit",
Expand Down
Loading
Loading