-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
26 lines (25 loc) · 834 Bytes
/
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
import { StatusBar } from 'expo-status-bar';
import React, { createContext, useState } from 'react';
import { Text, View } from 'react-native';
import Home from './Components/Home/Home';
import Welcome from './Components/Welcome/Welcome';
export const userContext = createContext()
export const ModifyContext = createContext()
export default function App() {
const [modify, setModify] = useState(1)
const [user, setUser] = useState({})
const [page, setPage] = useState('welcome')
return (
<userContext.Provider value={[user, setUser, page, setPage]}>
<ModifyContext.Provider value={[modify, setModify]}>
<>
{
page === 'welcome' ?
<Welcome></Welcome>
: <Home></Home>
}
</>
</ModifyContext.Provider>
</userContext.Provider>
);
}