Skip to content

Commit e788abc

Browse files
committed
Update usePrefetchImmediately snippet
1 parent 22418fe commit e788abc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/rtk-query/usage/prefetching.mdx

+2-2
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,9 @@ export function usePrefetchImmediately<T extends EndpointNames>(
8989
arg: Parameters<typeof api.endpoints[T]['initiate']>[0],
9090
options: PrefetchOptions = {}
9191
) {
92-
const dispatch = useDispatch()
92+
const dispatch = useAppDispatch()
9393
useEffect(() => {
94-
dispatch(api.util.prefetch(endpoint, arg, options))
94+
dispatch(api.util.prefetch(endpoint, arg as any, options))
9595
}, [])
9696
}
9797

0 commit comments

Comments
 (0)