Skip to content

Commit

Permalink
chore: distinguish version
Browse files Browse the repository at this point in the history
  • Loading branch information
fz6m committed Mar 1, 2024
1 parent d0e9d69 commit ddec535
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/plugins/src/react-query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export default (api: IApi) => {
? `
import React from 'react';
import {
${useV5 ? '' : 'defaultContext,'}
${useV4 ? 'defaultContext,' : ''}
QueryClient,
QueryClientProvider
} from '${pkgPath}';
Expand All @@ -124,13 +124,13 @@ export function rootContainer(container) {
return (
<QueryClientProvider
client={client}
${useV5 ? '' : 'context={defaultContext}'}
${useV4 ? 'context={defaultContext}' : ''}
>
{container}
${
enableDevTools
? `<ReactQueryDevtools
${useV5 ? '' : 'context={defaultContext}'}
${useV4 ? 'context={defaultContext}' : ''}
initialIsOpen={false}
{...(reactQueryConfig.devtool || {})}
/>`
Expand Down Expand Up @@ -184,7 +184,7 @@ export type {
QueriesOptions,
QueryErrorResetBoundaryProps,
QueryClientProviderProps,
${useV5 ? '' : 'ContextOptions as QueryContextOptions,'}
${useV4 ? 'ContextOptions as QueryContextOptions,' : ''}
UseQueryOptions,
UseBaseQueryOptions,
UseQueryResult,
Expand Down

0 comments on commit ddec535

Please sign in to comment.