29 lines
560 B
TypeScript
29 lines
560 B
TypeScript
import { PropsWithChildren } from 'react'
|
|
import { useLaunch } from '@tarojs/taro'
|
|
import { RecoilRoot } from 'recoil'
|
|
|
|
import './styles/tailwind.basic.css'
|
|
import { getGlobalConfig } from './apis'
|
|
|
|
|
|
function App({ children }: PropsWithChildren<any>) {
|
|
useLaunch(() => {
|
|
// 初始化全局配置
|
|
loadGlobalConfig()
|
|
console.log('App launched.')
|
|
})
|
|
|
|
const loadGlobalConfig = async () => {
|
|
const res = await getGlobalConfig()
|
|
console.log(res)
|
|
}
|
|
|
|
return (
|
|
<RecoilRoot>
|
|
{children}
|
|
</RecoilRoot>
|
|
)
|
|
}
|
|
|
|
export default App
|