Skip to content
Source
Sign inSign up
TanStack/query

refetchInterval not working #4584

Send to my agent
ClosedWillham12(GitHub profile, opens in a new tab) opened this issue 5 comments

Describe the bug

refetchInterval not working with 4.19.0, with 4.18.0 everything is fine

Your minimal, reproducible example

https://github.com/TanStack/query/issues/new

Steps to reproduce

		useQuery([QueryKeys.job], job, {
			refetchInterval: 2000,
			enabled: paymentLinkResource !== undefined,
			onSuccess: () => { console.log("log")
			}});

Expected behavior

refetch every 200ms

How often does this bug happen?

Every time

Screenshots or Videos

No response

Platform

iOS

Tanstack Query version

4.19.0

TypeScript version

3.8

Additional context

...

  1. provide a reproduction please

  2. TkDodo added labelsneeds-info

  3. Same issue here in React Native using 4.19.0. This query doesn't work:

    const { data } = useQuery(
            ['query-key'],
            () => {
               console.log("runQuery"); 
                return 1;
           },
            {
                refetchInterval: 1000,
            }
       );
  4. what does typeof document yield in react-native please? This is the only change we made:

  5. TkDodo added labelsreact-native

  6. I tried to create a basic reproduction in expo snack:

    it works fine in the web view, but as soon as I try to create an ios view, I'm getting:

    App.js (1235:889)
    Unable to resolve module 'module://react-dom.js'
    (Device)
      Evaluating module://react-dom.js
      Evaluating module://@tanstack/react-query.js
      Evaluating module://App.js.js
      Loading module://App.js

    I don't know enough about react-native or expo snack to understand this error. Maybe someone else can take it from here?

  7. TkDodo removed labelsneeds-info

  8. TkDodo added labelsbug

  9. TkDodo closed this

Sign in to join this conversation.