import 'abortcontroller-polyfill/dist/abortcontroller-polyfill-only';
import '@/utils/headers-polyfill.js'
import { PropsWithChildren } from 'react'
import { useLaunch } from '@tarojs/taro'
import { QueryClientProvider } from '@tanstack/react-query'
import { AuthProvider, queryClient } from './utils/auth'

import './app.css'

function App({ children }: PropsWithChildren<any>) {
  useLaunch(() => {
    console.log('App launched.')
  })

  // children 是将要会渲染的页面
  return (
    <QueryClientProvider client={queryClient}>
      <AuthProvider>{children}</AuthProvider>
    </QueryClientProvider>
  )
}

export default App
