-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathApp.js
More file actions
27 lines (23 loc) · 703 Bytes
/
App.js
File metadata and controls
27 lines (23 loc) · 703 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
import React, { useEffect } from 'react';
import { useSelector, useDispatch } from 'react-redux';
import { Text, Container, Content } from 'native-base';
import { initAuthenticator } from './store/actions';
import ActionList from './components/ActionList';
const App: () => React$Node = () => {
const initialized = useSelector(state => !!state.service.authenticator);
const dispatch = useDispatch();
useEffect(() => {
dispatch(initAuthenticator());
}, [dispatch]);
return (
<>
<Container>
<Content>
{initialized && <ActionList />}
{!initialized && <Text>loading...</Text>}
</Content>
</Container>
</>
);
};
export default App;