Skip to content

Commit 742955d

Browse files
authored
Merge pull request #240 from flexbox/feat/expo-tools
feat: 🎸 add expo-tools to spacecraft
2 parents 37d995c + ee1f6e2 commit 742955d

File tree

5 files changed

+69
-7
lines changed

5 files changed

+69
-7
lines changed

challenges/foundation/02.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,3 +135,5 @@ Create a better UX to show/hide the password:
135135
- [ ] Add a function to toggle the password visibility.
136136

137137
![password](https://raw.githubusercontent.com/flexbox/react-native-workshop/main/challenges/foundation/password.gif)
138+
139+
- [ ] Check [`Expo.new`](https://expo.dev/onboarding/hello) and try to create a new project. It will setup and deploy everything for you.

challenges/react-navigation/02.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,10 @@ You can use these component to make it pretty:
3939

4040
- [ ] Change the `screenOptions` to display your screen as a `modal`.
4141
- [ ] Add a "close modal" Button with an icon.
42+
- [ ] Add [`expo-dev-tools`](https://docs.expo.dev/debugging/devtools-plugins/#expo-dev-tools-plugins) to your project
43+
44+
- [ ] Look with the `expo-dev-tools` the `route` and `params` of the screen.
45+
46+
Start the project with and open the `expo-dev-tools` with `?` and `shift + m` in your terminal to open the menu and select `@dev-plugins/react-navigation`.
47+
48+
Now you can navigate in your app and see the `route` and `params` of the screen.

hackathon/spacecraft/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
]
2525
},
2626
"dependencies": {
27+
"@dev-plugins/react-navigation": "^0.0.6",
2728
"@expo/metro-runtime": "~3.2.1",
2829
"@expo/vector-icons": "^14.0.0",
2930
"@react-native-async-storage/async-storage": "1.23.1",

hackathon/spacecraft/src/navigation/Navigator.tsx

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
import React from "react";
2-
import { NavigationContainer } from "@react-navigation/native";
2+
import { useReactNavigationDevTools } from "@dev-plugins/react-navigation";
3+
import {
4+
NavigationContainer,
5+
useNavigationContainerRef,
6+
} from "@react-navigation/native";
37
import { createNativeStackNavigator } from "@react-navigation/native-stack";
48

59
import { AuthNavigator } from "./AuthNavigator";
@@ -14,8 +18,15 @@ export const Navigator = () => {
1418
const { user } = useAuthentication();
1519
const appearanceTheme = useAppearanceTheme();
1620

21+
const navigationRef = useNavigationContainerRef();
22+
23+
useReactNavigationDevTools(navigationRef);
24+
1725
return (
18-
<NavigationContainer theme={appearanceTheme}>
26+
<NavigationContainer
27+
ref={navigationRef}
28+
theme={appearanceTheme}
29+
>
1930
<Stack.Navigator screenOptions={{ headerShown: false }}>
2031
{user ? (
2132
<Stack.Screen

hackathon/spacecraft/yarn.lock

Lines changed: 46 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1318,6 +1318,14 @@
13181318
resolved "https://registry.yarnpkg.com/@colors/colors/-/colors-1.5.0.tgz#bb504579c1cae923e6576a4f5da43d25f97bdbd9"
13191319
integrity sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==
13201320

1321+
"@dev-plugins/react-navigation@^0.0.6":
1322+
version "0.0.6"
1323+
resolved "https://registry.yarnpkg.com/@dev-plugins/react-navigation/-/react-navigation-0.0.6.tgz#46cf1b498aca6a3e0adfd136eaaa4bbfbe73ddab"
1324+
integrity sha512-DBuNhCyo0kqYPxZzirL4TZBemOGHBI1pxxF6LOU4WlsVaCK16PJvvtgoD2Tbd0xS64fdfaDyISrn16RbIncy5A==
1325+
dependencies:
1326+
"@react-navigation/devtools" "^6.0.20"
1327+
nanoid "^3.1.23"
1328+
13211329
"@discoveryjs/json-ext@^0.5.3":
13221330
version "0.5.7"
13231331
resolved "https://registry.yarnpkg.com/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz#1d572bfbbe14b7704e0ba0f39b74815b84870d70"
@@ -3197,6 +3205,15 @@
31973205
react-is "^16.13.0"
31983206
use-latest-callback "^0.1.9"
31993207

3208+
"@react-navigation/devtools@^6.0.20":
3209+
version "6.0.26"
3210+
resolved "https://registry.yarnpkg.com/@react-navigation/devtools/-/devtools-6.0.26.tgz#c422c05edfb998d6939317a74a324dd598a2f13b"
3211+
integrity sha512-jbIb+678wb75Z1OiA/zP2g7ZuAviL9IFFTiadEcGog713n7XTm5xRr6uiCPWohalUJOvt8e9B8A2wRGmgELjHw==
3212+
dependencies:
3213+
deep-equal "^2.0.5"
3214+
nanoid "^3.1.23"
3215+
stacktrace-parser "^0.1.10"
3216+
32003217
"@react-navigation/elements@^1.3.30":
32013218
version "1.3.30"
32023219
resolved "https://registry.yarnpkg.com/@react-navigation/elements/-/elements-1.3.30.tgz#a81371f599af1070b12014f05d6c09b1a611fd9a"
@@ -5734,7 +5751,7 @@ arr-union@^3.1.0:
57345751
resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4"
57355752
integrity sha512-sKpyeERZ02v1FeCZT8lrfJq5u6goHCtpTAzPwJYe7c8SPFOboNjNg1vz2L4VTn9T4PQxEx13TbXLmYUcS6Ug7Q==
57365753

5737-
array-buffer-byte-length@^1.0.1:
5754+
array-buffer-byte-length@^1.0.0, array-buffer-byte-length@^1.0.1:
57385755
version "1.0.1"
57395756
resolved "https://registry.yarnpkg.com/array-buffer-byte-length/-/array-buffer-byte-length-1.0.1.tgz#1e5583ec16763540a27ae52eed99ff899223568f"
57405757
integrity sha512-ahC5W1xgou+KTXix4sAO8Ki12Q+jf4i0+tmk3sC+zgcynshkHxzpXdImBehiUYKKKDwvfFiJl1tZt6ewscS1Mg==
@@ -7579,6 +7596,30 @@ deep-equal@^1.0.1:
75797596
object-keys "^1.1.1"
75807597
regexp.prototype.flags "^1.5.1"
75817598

7599+
deep-equal@^2.0.5:
7600+
version "2.2.3"
7601+
resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-2.2.3.tgz#af89dafb23a396c7da3e862abc0be27cf51d56e1"
7602+
integrity sha512-ZIwpnevOurS8bpT4192sqAowWM76JDKSHYzMLty3BZGSswgq6pBaH3DhCSW5xVAZICZyKdOBPjwww5wfgT/6PA==
7603+
dependencies:
7604+
array-buffer-byte-length "^1.0.0"
7605+
call-bind "^1.0.5"
7606+
es-get-iterator "^1.1.3"
7607+
get-intrinsic "^1.2.2"
7608+
is-arguments "^1.1.1"
7609+
is-array-buffer "^3.0.2"
7610+
is-date-object "^1.0.5"
7611+
is-regex "^1.1.4"
7612+
is-shared-array-buffer "^1.0.2"
7613+
isarray "^2.0.5"
7614+
object-is "^1.1.5"
7615+
object-keys "^1.1.1"
7616+
object.assign "^4.1.4"
7617+
regexp.prototype.flags "^1.5.1"
7618+
side-channel "^1.0.4"
7619+
which-boxed-primitive "^1.0.2"
7620+
which-collection "^1.0.1"
7621+
which-typed-array "^1.1.13"
7622+
75827623
deep-extend@^0.6.0:
75837624
version "0.6.0"
75847625
resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac"
@@ -8108,7 +8149,7 @@ es-errors@^1.0.0, es-errors@^1.1.0, es-errors@^1.2.1, es-errors@^1.3.0:
81088149
resolved "https://registry.yarnpkg.com/es-errors/-/es-errors-1.3.0.tgz#05f75a25dab98e4fb1dcd5e1472c0546d5057c8f"
81098150
integrity sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==
81108151

8111-
es-get-iterator@^1.0.2:
8152+
es-get-iterator@^1.0.2, es-get-iterator@^1.1.3:
81128153
version "1.1.3"
81138154
resolved "https://registry.yarnpkg.com/es-get-iterator/-/es-get-iterator-1.1.3.tgz#3ef87523c5d464d41084b2c3c9c214f1199763d6"
81148155
integrity sha512-sPZmqHBe6JIiTfN5q2pEi//TwxmAFHwj/XEuYjTuse78i8KxaqMTTzxPoFKuzRpDpTJ+0NAbpfenkmH2rePtuw==
@@ -9508,7 +9549,7 @@ get-caller-file@^2.0.1, get-caller-file@^2.0.5:
95089549
resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e"
95099550
integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==
95109551

9511-
get-intrinsic@^1.1.3, get-intrinsic@^1.2.1, get-intrinsic@^1.2.3, get-intrinsic@^1.2.4:
9552+
get-intrinsic@^1.1.3, get-intrinsic@^1.2.1, get-intrinsic@^1.2.2, get-intrinsic@^1.2.3, get-intrinsic@^1.2.4:
95129553
version "1.2.4"
95139554
resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.2.4.tgz#e385f5a4b5227d449c3eabbad05494ef0abbeadd"
95149555
integrity sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==
@@ -10343,7 +10384,7 @@ is-arguments@^1.0.4, is-arguments@^1.1.1:
1034310384
call-bind "^1.0.2"
1034410385
has-tostringtag "^1.0.0"
1034510386

10346-
is-array-buffer@^3.0.4:
10387+
is-array-buffer@^3.0.2, is-array-buffer@^3.0.4:
1034710388
version "3.0.4"
1034810389
resolved "https://registry.yarnpkg.com/is-array-buffer/-/is-array-buffer-3.0.4.tgz#7a1f92b3d61edd2bc65d24f130530ea93d7fae98"
1034910390
integrity sha512-wcjaerHw0ydZwfhiKbXJWLDY8A7yV7KhjQOpb83hGgGfId/aQa4TOvwyzn2PuswW2gPCYEL/nEAiSVpdOj1lXw==
@@ -16933,7 +16974,7 @@ which-module@^2.0.0:
1693316974
resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.1.tgz#776b1fe35d90aebe99e8ac15eb24093389a4a409"
1693416975
integrity sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==
1693516976

16936-
which-typed-array@^1.1.14, which-typed-array@^1.1.15, which-typed-array@^1.1.2, which-typed-array@^1.1.9:
16977+
which-typed-array@^1.1.13, which-typed-array@^1.1.14, which-typed-array@^1.1.15, which-typed-array@^1.1.2, which-typed-array@^1.1.9:
1693716978
version "1.1.15"
1693816979
resolved "https://registry.yarnpkg.com/which-typed-array/-/which-typed-array-1.1.15.tgz#264859e9b11a649b388bfaaf4f767df1f779b38d"
1693916980
integrity sha512-oV0jmFtUky6CXfkqehVvBP/LSWJ2sy4vWMioiENyJLePrBO/yKyV9OyJySfAKosh+RYkIl5zJCNZ8/4JncrpdA==

0 commit comments

Comments
 (0)