devtools
开发工具
导入开发工具
import { ReactQueryDevtools } from 'react-query/devtools'
浮动模式
import { ReactQueryDevtools } from 'react-query/devtools'
function App() {
return (
<QueryClientProvider client={queryClient}>
{/* The rest of your application */}
<ReactQueryDevtools initialIsOpen={false} />
</QueryClientProvider>
)
}
选项
- initialIsOpen: Boolean
- 初始化打开状态
- panelProps: PropsObject
- Use this to add props to the panel. For example, you can add className, style (merge and override default style), etc.
- closeButtonProps: PropsObject
- Use this to add props to the close button. For example, you can add className, style (merge and override default style), onClick (extend default handler), etc.
- toggleButtonProps: PropsObject
- Use this to add props to the toggle button. For example, you can add className, style (merge and override default style), onClick (extend default handler), etc.
- position?: "top-left" | "top-right" | "bottom-left" | "bottom-right"
- 默认为,bottom-left
- 显示位置
嵌入模式
import { ReactQueryDevtoolsPanel } from 'react-query/devtools'
function App() {
return (
<QueryClientProvider client={queryClient}>
{/* The rest of your application */}
<ReactQueryDevtoolsPanel style={styles} className={className} />
</QueryClientProvider>
)
}