app.tsx 532 B

123456789101112131415161718192021
  1. import { PropsWithChildren } from 'react'
  2. import { useLaunch } from '@tarojs/taro'
  3. import { QueryClientProvider } from '@tanstack/react-query'
  4. import { AuthProvider, queryClient } from './utils/auth'
  5. import './app.css'
  6. function App({ children }: PropsWithChildren<any>) {
  7. useLaunch(() => {
  8. console.log('App launched.')
  9. })
  10. // children 是将要会渲染的页面
  11. return (
  12. <QueryClientProvider client={queryClient}>
  13. <AuthProvider>{children}</AuthProvider>
  14. </QueryClientProvider>
  15. )
  16. }
  17. export default App