import { ComponentType } from 'react'; import { QueryClientProvider } from '@tanstack/react-query'; import { queryClient as defaultQueryClient } from './react-query'; export function withReactQuery( WrappedComponent: ComponentType, queryClient = defaultQueryClient ): ComponentType { // Try to create a nice displayName for React Dev Tools. const displayName = WrappedComponent.displayName || WrappedComponent.name || 'Component'; function WrapperComponent(props: T & JSX.IntrinsicAttributes) { return ( ); } WrapperComponent.displayName = `withReactQuery(${displayName})`; return WrapperComponent; }