Skip to content

Commit 87d396c

Browse files
chore(expo-sample): Add Expo Dev Client (#4810)
1 parent c10f417 commit 87d396c

File tree

3 files changed

+75
-3
lines changed

3 files changed

+75
-3
lines changed

samples/expo/app/(tabs)/index.tsx

+12-3
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,16 @@ import { Button, StyleSheet } from 'react-native';
22
import Constants from 'expo-constants';
33
import * as Sentry from '@sentry/react-native';
44
import { reloadAppAsync } from 'expo';
5+
import * as DevClient from 'expo-dev-client';
56

67
import { Text, View } from '@/components/Themed';
78
import { setScopeProperties } from '@/utils/setScopeProperties';
89
import React from 'react';
910
import * as WebBrowser from 'expo-web-browser';
1011
import { useUpdates } from 'expo-updates';
12+
import { isWeb } from '../../utils/isWeb';
1113

12-
const isRunningInExpoGo = Constants.appOwnership === 'expo'
14+
const isRunningInExpoGo = Constants.appOwnership === 'expo';
1315

1416
export default function TabOneScreen() {
1517
const { currentlyRunning } = useUpdates();
@@ -20,6 +22,13 @@ export default function TabOneScreen() {
2022
<Text>Update ID: {currentlyRunning.updateId}</Text>
2123
<Text>Channel: {currentlyRunning.channel}</Text>
2224
<Text>Runtime Version: {currentlyRunning.runtimeVersion}</Text>
25+
<Button
26+
title="Open DevMenu"
27+
onPress={() => {
28+
DevClient.openMenu();
29+
}}
30+
disabled={isWeb()}
31+
/>
2332
<Button
2433
title="Capture message"
2534
onPress={() => {
@@ -35,8 +44,8 @@ export default function TabOneScreen() {
3544
<Button
3645
title="Capture exception with cause"
3746
onPress={() => {
38-
const error = new Error('Captured exception')
39-
error.cause = new Error('Cause of captured exception')
47+
const error = new Error('Captured exception');
48+
error.cause = new Error('Cause of captured exception');
4049
Sentry.captureException(error);
4150
}}
4251
/>

samples/expo/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"@types/react": "~19.0.10",
2222
"expo": "^53.0.0",
2323
"expo-constants": "~17.1.5",
24+
"expo-dev-client": "~5.1.8",
2425
"expo-image-picker": "~16.1.4",
2526
"expo-linking": "~7.1.4",
2627
"expo-router": "~5.0.5",

yarn.lock

+62
Original file line numberDiff line numberDiff line change
@@ -10214,6 +10214,18 @@ __metadata:
1021410214
languageName: node
1021510215
linkType: hard
1021610216

10217+
"ajv@npm:8.11.0":
10218+
version: 8.11.0
10219+
resolution: "ajv@npm:8.11.0"
10220+
dependencies:
10221+
fast-deep-equal: ^3.1.1
10222+
json-schema-traverse: ^1.0.0
10223+
require-from-string: ^2.0.2
10224+
uri-js: ^4.2.2
10225+
checksum: 5e0ff226806763be73e93dd7805b634f6f5921e3e90ca04acdf8db81eed9d8d3f0d4c5f1213047f45ebbf8047ffe0c840fa1ef2ec42c3a644899f69aa72b5bef
10226+
languageName: node
10227+
linkType: hard
10228+
1021710229
"ajv@npm:8.12.0":
1021810230
version: 8.12.0
1021910231
resolution: "ajv@npm:8.12.0"
@@ -14994,6 +15006,55 @@ __metadata:
1499415006
languageName: node
1499515007
linkType: hard
1499615008

15009+
"expo-dev-client@npm:~5.1.8":
15010+
version: 5.1.8
15011+
resolution: "expo-dev-client@npm:5.1.8"
15012+
dependencies:
15013+
expo-dev-launcher: 5.1.11
15014+
expo-dev-menu: 6.1.10
15015+
expo-dev-menu-interface: 1.10.0
15016+
expo-manifests: ~0.16.4
15017+
expo-updates-interface: ~1.1.0
15018+
peerDependencies:
15019+
expo: "*"
15020+
checksum: 03334ad506fd9046a70b3bef4768157fa8413e6b2c93d5a03aa1696515b273ef7142d6501b6f363151ec7ad94548bd863853e2fea84fd3a675e9130c12cc8ef1
15021+
languageName: node
15022+
linkType: hard
15023+
15024+
"expo-dev-launcher@npm:5.1.11":
15025+
version: 5.1.11
15026+
resolution: "expo-dev-launcher@npm:5.1.11"
15027+
dependencies:
15028+
ajv: 8.11.0
15029+
expo-dev-menu: 6.1.10
15030+
expo-manifests: ~0.16.4
15031+
resolve-from: ^5.0.0
15032+
peerDependencies:
15033+
expo: "*"
15034+
checksum: 87330727f1e7ec82da9c3603ff0f8f7b0c75dbebc4345bcc54d60abd08eff0ec17e1359f36db80a59f153de5247751fbe91ac2c52b3ffe3a2fe1755e55d0ae43
15035+
languageName: node
15036+
linkType: hard
15037+
15038+
"expo-dev-menu-interface@npm:1.10.0":
15039+
version: 1.10.0
15040+
resolution: "expo-dev-menu-interface@npm:1.10.0"
15041+
peerDependencies:
15042+
expo: "*"
15043+
checksum: b2e5ae7df33f8a903406357bce0ae3cd131a43bec1ebc28fc87a3db2591d428628693767dac895361171999f7c3c2c41f2cd31d67a4b4d3336aaa2f08d65c866
15044+
languageName: node
15045+
linkType: hard
15046+
15047+
"expo-dev-menu@npm:6.1.10":
15048+
version: 6.1.10
15049+
resolution: "expo-dev-menu@npm:6.1.10"
15050+
dependencies:
15051+
expo-dev-menu-interface: 1.10.0
15052+
peerDependencies:
15053+
expo: "*"
15054+
checksum: e2ca4447307a28d36f9ca83bcddcc2cc8499eddf3bf7357abfbd37142d0e28329a6b8aca00707e7f4e883768e4d16c4f33bbbb978d8b9cfc216b03c6179c0408
15055+
languageName: node
15056+
linkType: hard
15057+
1499715058
"expo-eas-client@npm:~0.14.3":
1499815059
version: 0.14.3
1499915060
resolution: "expo-eas-client@npm:0.14.3"
@@ -25361,6 +25422,7 @@ __metadata:
2536125422
"@types/react": ~19.0.10
2536225423
expo: ^53.0.0
2536325424
expo-constants: ~17.1.5
25425+
expo-dev-client: ~5.1.8
2536425426
expo-image-picker: ~16.1.4
2536525427
expo-linking: ~7.1.4
2536625428
expo-router: ~5.0.5

0 commit comments

Comments
 (0)