Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(react-query): add support for react19 in v4 #8441

Draft
wants to merge 6 commits into
base: v4
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions packages/react-query-devtools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,15 @@
"build:types": "tsc --build && cp build/lib/index.d.ts build/lib/index.prod.d.ts"
},
"devDependencies": {
"@types/react": "^18.0.14",
"@types/react-dom": "^18.0.5",
"@types/react": "^19.0.0",
"@types/react-dom": "^19.0.0",
"@types/use-sync-external-store": "^0.0.3",
"react": "^18.2.0",
"react": "^19.0.0",
"react-17": "npm:react@^17.0.2",
"react-dom": "^18.2.0",
"react-18": "npm:react@^18.0.14",
"react-dom": "^19.0.0",
"react-dom-17": "npm:react-dom@^17.0.2",
"react-dom-18": "npm:react-dom@^18.2.0",
"react-error-boundary": "^3.1.4",
"@tanstack/react-query": "workspace:*"
},
Expand All @@ -66,8 +68,8 @@
"use-sync-external-store": "^1.2.0"
},
"peerDependencies": {
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0",
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
"@tanstack/react-query": "workspace:^"
}
}
4 changes: 2 additions & 2 deletions packages/react-query-devtools/src/Explorer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ type Entry = {
}

type RendererProps = {
handleEntry: (entry: Entry) => JSX.Element
handleEntry: (entry: Entry) => React.JSX.Element
label?: string
value: unknown
subEntries: Entry[]
Expand Down Expand Up @@ -220,7 +220,7 @@ export function chunkArray<T>(array: T[], size: number): T[][] {
return result
}

type Renderer = (props: RendererProps) => JSX.Element
type Renderer = (props: RendererProps) => React.JSX.Element

export const DefaultRenderer: Renderer = ({
handleEntry,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -931,7 +931,7 @@ describe('ReactQueryDevtools', () => {
paddingRight: '20%',
}

function Parent({ children }: { children: React.ReactElement }) {
function Parent({ children }: { children: React.ReactNode }) {
return (
<div data-testid={parentElementTestid} style={parentPaddings}>
{children}
Expand Down
10 changes: 6 additions & 4 deletions packages/react-query-persist-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,14 @@
"build:types": "tsc --build"
},
"devDependencies": {
"@types/react": "^18.0.14",
"@types/react-dom": "^18.0.5",
"react": "^18.2.0",
"@types/react": "^19.0.0",
"@types/react-dom": "^19.0.0",
"react": "^19.0.0",
"react-17": "npm:react@^17.0.2",
"react-dom": "^18.2.0",
"react-18": "npm:react@^18.0.14",
"react-dom": "^19.0.0",
"react-dom-17": "npm:react-dom@^17.0.2",
"react-dom-18": "npm:react-dom@^18.0.5",
"@tanstack/react-query": "workspace:*"
},
"dependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const PersistQueryClientProvider = ({
persistOptions,
onSuccess,
...props
}: PersistQueryClientProviderProps): JSX.Element => {
}: PersistQueryClientProviderProps): React.JSX.Element => {
const [isRestoring, setIsRestoring] = React.useState(true)
const refs = React.useRef({ persistOptions, onSuccess })
const didRestore = React.useRef(false)
Expand Down
14 changes: 8 additions & 6 deletions packages/react-query/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,15 @@
],
"devDependencies": {
"@types/jscodeshift": "^0.11.3",
"@types/react": "^18.0.14",
"@types/react-dom": "^18.0.5",
"@types/react": "^19.0.0",
"@types/react-dom": "^19.0.0",
"@types/use-sync-external-store": "^0.0.3",
"react": "^18.2.0",
"react": "^19.0.0",
"react-17": "npm:react@^17.0.2",
"react-dom": "^18.2.0",
"react-18": "npm:react@^18.2.0",
"react-dom": "^19.0.0",
"react-dom-17": "npm:react-dom@^17.0.2",
"react-dom-18": "npm:react-dom@^18.2.0",
"jscodeshift": "^0.13.1",
"react-error-boundary": "^3.1.4"
},
Expand All @@ -62,8 +64,8 @@
"use-sync-external-store": "^1.2.0"
},
"peerDependencies": {
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0",
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
"react-native": "*"
},
"peerDependenciesMeta": {
Expand Down
2 changes: 1 addition & 1 deletion packages/react-query/src/QueryClientProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export const QueryClientProvider = ({
children,
context,
contextSharing = false,
}: QueryClientProviderProps): JSX.Element => {
}: QueryClientProviderProps): React.JSX.Element => {
React.useEffect(() => {
client.mount()
return () => {
Expand Down
Loading
Loading