tooot/App.tsx

52 lines
1.3 KiB
TypeScript
Raw Normal View History

2020-10-31 21:04:46 +01:00
import React from 'react'
2020-11-23 00:07:32 +01:00
import { AppearanceProvider } from 'react-native-appearance'
import { QueryCache, ReactQueryCacheProvider, setConsole } from 'react-query'
2020-11-21 13:19:05 +01:00
import { Provider } from 'react-redux'
2020-11-23 00:07:32 +01:00
import ThemeManager from 'src/utils/styles/ThemeManager'
2020-10-31 21:04:46 +01:00
import { Index } from 'src/Index'
import { persistor, store } from 'src/store'
import { PersistGate } from 'redux-persist/integration/react'
2020-10-31 21:04:46 +01:00
const queryCache = new QueryCache()
setConsole({
log: console.log,
warn: console.warn,
error: console.warn
})
2020-11-28 17:07:30 +01:00
// if (__DEV__) {
// const whyDidYouRender = require('@welldone-software/why-did-you-render')
// whyDidYouRender(React, {
// trackAllPureComponents: true,
// trackHooks: true,
// hotReloadBufferMs: 1000
// })
// }
2020-11-17 23:57:23 +01:00
2020-11-23 00:07:32 +01:00
const App: React.FC = () => {
return (
<AppearanceProvider>
<ThemeManager>
<ReactQueryCacheProvider queryCache={queryCache}>
<Provider store={store}>
<PersistGate persistor={persistor}>
{bootstrapped => {
if (bootstrapped) {
require('src/i18n/i18n')
return <Index />
} else {
return <></>
}
}}
</PersistGate>
2020-11-23 00:07:32 +01:00
</Provider>
</ReactQueryCacheProvider>
</ThemeManager>
</AppearanceProvider>
)
}
2020-10-31 21:04:46 +01:00
export default App