Skip to content

Commit

Permalink
upgraded to latest react navigation v6, removed registerRootComponent…
Browse files Browse the repository at this point in the history
…() usage, and converted App.js to function component
  • Loading branch information
calebnance committed Apr 16, 2022
1 parent 92ed627 commit cdda318
Show file tree
Hide file tree
Showing 4 changed files with 2,122 additions and 3,056 deletions.
34 changes: 34 additions & 0 deletions App.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import * as React from 'react';
import { StatusBar } from 'react-native';
import AppLoading from 'expo-app-loading';
import { func } from './src/constants';

// main navigation stack
import RootStack from './src/navigation/RootStack';

const App = () => {
const [isLoading, setIsLoading] = React.useState(true);

// pre-loading assets/fonts?
if (isLoading) {
return (
<AppLoading
onError={() => {
// console.warn
}}
onFinish={() => setIsLoading(false)}
startAsync={func.loadAssetsAsync}
/>
);
}

return (
<React.Fragment>
<StatusBar barStyle="light-content" />

<RootStack />
</React.Fragment>
);
};

export default App;
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"react navigation",
"netflix"
],
"main": "src/App.js",
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"dev": "expo start",
"start": "expo start",
Expand All @@ -24,9 +24,9 @@
"dependencies": {
"@react-native-community/masked-view": "0.1.10",
"@react-native-masked-view/masked-view": "0.2.6",
"@react-navigation/bottom-tabs": "^6.0.4",
"@react-navigation/native": "^6.0.2",
"@react-navigation/stack": "^6.0.6",
"@react-navigation/bottom-tabs": "^6.3.1",
"@react-navigation/native": "^6.0.10",
"@react-navigation/stack": "^6.2.1",
"expo": "^44.0.0",
"expo-app-loading": "~1.3.0",
"expo-asset": "~8.4.6",
Expand Down
44 changes: 0 additions & 44 deletions src/App.js

This file was deleted.

Loading

0 comments on commit cdda318

Please sign in to comment.