You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert

44
53
45
-
-[ ] Change the entry point of your application and comment your `default export` to return Storybook's UI.
54
+
-[ ] Change the entry point of your application to conditionally load Storybook based on the environment variable:
-[ ] Create a new file `./src/components/Text.stories.tsx`:
@@ -155,5 +195,4 @@ Default.story = {
155
195
156
196
## 👽 Bonus
157
197
158
-
-[ ] Update your `package.json` with `STORYBOOK_ENABLED` to [swap between React Native Storybook and your app](https://dev.to/dannyhw/how-to-swap-between-react-native-storybook-and-your-app-p3o).
159
198
-[ ] You can [watch me live coding with Dany](https://www.youtube.com/watch?v=QgYPgDxJRkU) the maintainer of Storybook React Native.
-[ ] Read the [Getting started](https://docs.expo.dev/router/installation/) guide to:
23
+
1. Install `expo-router` in your React Native project.
24
+
2. Configure the entry point in `package.json` and `app.json`.
25
+
26
+
**🔭 Hint:** With Expo Router, routes are automatically generated based on the file structure in the `app/` directory.
27
+
28
+
### Create your first routes
29
+
30
+
-[ ] Create a new `app/` directory at the root of your project.
31
+
-[ ] Create an `app/_layout.tsx` file to define your root layout:
32
+
33
+
```javascript
34
+
// app/_layout.tsx
35
+
import { Stack } from"expo-router";
36
+
37
+
exportdefaultfunctionRootLayout() {
38
+
return (
39
+
<Stack screenOptions={{ headerShown:false }}>
40
+
<Stack.Screen name="index"/>
41
+
<Stack.Screen name="terms"/>
42
+
</Stack>
43
+
);
44
+
}
45
+
```
46
+
47
+
-[ ] Create `app/index.tsx` for your `LoginScreen`.
48
+
-[ ] Create `app/terms.tsx` for your `TermsScreen`.
49
+
50
+
**🔭 Hint:** In Expo Router, `index.tsx` is the default route (like `index.html` on the web).
51
+
52
+
### Navigate to another screen
53
+
54
+
Do you remember the `<Text>` "by login you accept the Terms and Conditions."? We will use the `Link` component or `router.push()` to go to another screen.
0 commit comments