Skip to content

Commit cbbd64c

Browse files
authored
Update expo example app (#76)
* feat: update example app to SDK 46 * chore: bump react-native-size-matters version * chore: bump react-native-version * feat: refactor navigation * chore: add StatusBar
1 parent 3a97078 commit cbbd64c

File tree

7 files changed

+5741
-4647
lines changed

7 files changed

+5741
-4647
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
node_modules
22
coverage
3-
settings.json
3+
settings.json
4+
.expo

examples/expo-example-app/.babelrc

-8
This file was deleted.

examples/expo-example-app/App.js

+22-27
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,23 @@
1-
import React from 'react';
2-
import {StackNavigator} from 'react-navigation';
3-
import HomeScreen from './components/Home';
4-
import FeedPage from './components/Feed';
5-
import ChatPage from './components/Chat';
1+
import React from "react";
2+
import HomeScreen from "./components/Home";
3+
import FeedPage from "./components/Feed";
4+
import ChatPage from "./components/Chat";
5+
import { NavigationContainer } from "@react-navigation/native";
6+
import { createNativeStackNavigator } from "@react-navigation/native-stack";
7+
import { StatusBar } from "expo-status-bar";
68

7-
export default StackNavigator({
8-
Home: {
9-
screen: HomeScreen,
10-
navigationOptions: {
11-
title: 'Home'
12-
}
13-
},
14-
Chat: {
15-
screen: ChatPage,
16-
navigationOptions: {
17-
title: 'Chat'
18-
}
19-
},
20-
Feed: {
21-
screen: FeedPage,
22-
navigationOptions: {
23-
title: 'Feed'
24-
}
25-
}
26-
}, {
27-
initialRouteName: 'Home'
28-
});
9+
const NativeStack = createNativeStackNavigator();
10+
11+
export default function App() {
12+
return (
13+
<NavigationContainer>
14+
<StatusBar style="dark" />
15+
16+
<NativeStack.Navigator initialRouteName="Home">
17+
<NativeStack.Screen name="Home" component={HomeScreen} />
18+
<NativeStack.Screen name="Chat" component={ChatPage} />
19+
<NativeStack.Screen name="Feed" component={FeedPage} />
20+
</NativeStack.Navigator>
21+
</NavigationContainer>
22+
);
23+
}

examples/expo-example-app/app.json

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
"expo": {
33
"name": "Size Matters Example",
44
"slug": "size-matters",
5-
"sdkVersion": "22.0.0",
65
"privacy": "public"
76
}
87
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = function (api) {
2+
api.cache(true);
3+
return {
4+
presets: ["babel-preset-expo"],
5+
};
6+
};

examples/expo-example-app/package.json

+15-14
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,27 @@
33
"version": "0.1.0",
44
"private": true,
55
"devDependencies": {
6-
"jest-expo": "^22.0.0",
7-
"react-native-scripts": "1.7.0",
8-
"react-test-renderer": "16.0.0-beta.5"
6+
"@babel/core": "^7.12.9",
7+
"jest-expo": "^46.0.0"
98
},
10-
"main": "./node_modules/react-native-scripts/build/bin/crna-entry.js",
9+
"main": "node_modules/expo/AppEntry.js",
1110
"scripts": {
12-
"start": "react-native-scripts start",
13-
"eject": "react-native-scripts eject",
14-
"android": "react-native-scripts android",
15-
"ios": "react-native-scripts ios",
16-
"test": "node node_modules/jest/bin/jest.js --watch"
11+
"start": "expo start",
12+
"android": "expo start --android",
13+
"ios": "expo start --ios"
1714
},
1815
"jest": {
1916
"preset": "jest-expo"
2017
},
2118
"dependencies": {
22-
"expo": "^22.0.2",
23-
"react": "16.0.0-beta.5",
24-
"react-native": "^0.49.5",
25-
"react-native-size-matters": "^0.1.0",
26-
"react-navigation": "^1.0.0-beta.21"
19+
"@react-navigation/native": "^6.0.13",
20+
"@react-navigation/native-stack": "^6.9.1",
21+
"expo": "^46.0.0",
22+
"expo-status-bar": "~1.4.0",
23+
"react": "18.0.0",
24+
"react-native": "0.69.6",
25+
"react-native-safe-area-context": "4.3.1",
26+
"react-native-screens": "~3.15.0",
27+
"react-native-size-matters": "^0.4.0"
2728
}
2829
}

0 commit comments

Comments
 (0)