-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathApp.js
51 lines (43 loc) · 1.17 KB
/
App.js
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/**
* Sample React Native App
* https://github.com/facebook/react-native
*
* @format
*/
import AppContext from './src/components/AppContext';
import React, {useState} from 'react';
import {SafeAreaView, ScrollView, Text, View, StyleSheet} from 'react-native';
import MainStackNavigator from './src/navigation/MainStackNavigator';
import 'react-native-gesture-handler';
import Toast from 'react-native-toast-message';
export default function App() {
const [accessToken, setAccessToken] = useState('');
const [refreshToken, setRefreshToken] = useState('');
const [id, setId] = useState('');
const setAccessTokenValue = string => {
setAccessToken(string);
};
const setRefreshTokenValue = string => {
setRefreshToken(string);
};
const setIdValue = string => {
setId(string);
};
const tokens = {
accessToken: accessToken,
setAccessTokenValue,
refreshToken: refreshToken,
setRefreshTokenValue,
id: id,
setIdValue,
};
return (
<AppContext.Provider value={tokens}>
<MainStackNavigator />
<Toast ref={(ref) => Toast.setRef(ref)} />
</AppContext.Provider>
);
}
const styles = StyleSheet.create({
entire: {},
});