From d6942bffab68ce80d5cb26b42710dd9276f62ded Mon Sep 17 00:00:00 2001 From: Paul Frazee Date: Thu, 9 Jun 2022 13:03:25 -0500 Subject: Add state management --- src/App.native.tsx | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 src/App.native.tsx (limited to 'src/App.native.tsx') diff --git a/src/App.native.tsx b/src/App.native.tsx new file mode 100644 index 000000000..40989caf0 --- /dev/null +++ b/src/App.native.tsx @@ -0,0 +1,80 @@ +import React, {useState, useEffect} from 'react' +import { + SafeAreaView, + ScrollView, + StatusBar, + Text, + Button, + useColorScheme, + View, +} from 'react-native' +import {NavigationContainer} from '@react-navigation/native' +import { + createNativeStackNavigator, + NativeStackScreenProps, +} from '@react-navigation/native-stack' +import {RootStore, setupState, RootStoreProvider} from './state' + +type RootStackParamList = { + Home: undefined + Profile: {name: string} +} +const Stack = createNativeStackNavigator() + +const HomeScreen = ({ + navigation, +}: NativeStackScreenProps) => { + const isDarkMode = useColorScheme() === 'dark' + + return ( + + + + + Native +