-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.tsx
37 lines (32 loc) · 1.05 KB
/
App.tsx
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
// import 'core-js/stable';
import "./src/lib/filterConsole";
import {hot} from 'react-hot-loader';
import * as React from "react";
import {Platform} from "react-native";
import {Provider as PaperProvider} from './src/components/modules';
import {useSelector} from 'react-redux';
import {Navigation} from "./src/components/modules/navigation";
import {StoreState} from "./src/reducers";
import {StoreContainer} from "./src/components/containers/Store.container";
import {watchViewport} from "./src/hooks/watchViewport";
export function AppGuts(): React.ReactElement {
watchViewport();
const theme = useSelector((state: StoreState) => state.theme);
return (
<PaperProvider theme={theme}>
<Navigation theme={theme}/>
</PaperProvider>
);
}
let HotAppGuts = AppGuts;
if (Platform.OS === 'web') HotAppGuts = hot(module)(AppGuts);
class App extends React.PureComponent {
render() {
return (
<StoreContainer>
<HotAppGuts/>
</StoreContainer>
);
}
}
export default App;