App.jsx 517 B

12345678910111213141516171819202122232425
  1. // 文件路径: src/App.jsx
  2. import React from 'react';
  3. import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
  4. import Dashboard from './pages/Dashboard';
  5. import './App.css';
  6. // 创建 React Query 客户端
  7. const queryClient = new QueryClient({
  8. defaultOptions: {
  9. queries: {
  10. retry: 1,
  11. refetchOnWindowFocus: false,
  12. },
  13. },
  14. });
  15. function App() {
  16. return (
  17. <QueryClientProvider client={queryClient}>
  18. <Dashboard />
  19. </QueryClientProvider>
  20. );
  21. }
  22. export default App;