| 12345678910111213141516171819202122232425 |
- // 文件路径: src/App.jsx
- import React from 'react';
- import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
- import Dashboard from './pages/Dashboard';
- import './App.css';
- // 创建 React Query 客户端
- const queryClient = new QueryClient({
- defaultOptions: {
- queries: {
- retry: 1,
- refetchOnWindowFocus: false,
- },
- },
- });
- function App() {
- return (
- <QueryClientProvider client={queryClient}>
- <Dashboard />
- </QueryClientProvider>
- );
- }
- export default App;
|