-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathApp.jsx
More file actions
30 lines (23 loc) · 694 Bytes
/
App.jsx
File metadata and controls
30 lines (23 loc) · 694 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import React, { useState } from 'react';
import AppRoutes from './AppRoutes';
import { Provider } from 'react-redux';
import store from './store';
import { SafeAreaProvider } from 'react-native-safe-area-context';
import AsyncStorage from '@react-native-async-storage/async-storage';
function App() {
const [token, setToken] = useState('');
const getToken = async () => {
const token = await AsyncStorage.getItem('token');
// console.log(token);
setToken(token);
return token;
}
return (
<SafeAreaProvider>
<Provider store={store}>
{ getToken() ? <AppRoutes token={token} /> : <> </> }
</Provider>
</SafeAreaProvider>
);
}
export default App;