app.tsx 713 B

1234567891011121314151617181920212223242526
  1. import 'abortcontroller-polyfill/dist/abortcontroller-polyfill-only';
  2. import '@/utils/headers-polyfill.js'
  3. import { PropsWithChildren } from 'react'
  4. import { useLaunch } from '@tarojs/taro'
  5. import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
  6. import { AuthProvider } from './utils/auth'
  7. import './app.css'
  8. // 创建新的 QueryClient 实例
  9. const queryClient = new QueryClient()
  10. function App({ children }: PropsWithChildren<any>) {
  11. useLaunch(() => {
  12. console.log('App launched.')
  13. })
  14. // children 是将要会渲染的页面
  15. return (
  16. <QueryClientProvider client={queryClient}>
  17. <AuthProvider>{children}</AuthProvider>
  18. </QueryClientProvider>
  19. )
  20. }
  21. export default App