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

refetchInterval not working #4584

Closed
Willham12 opened this issue Dec 2, 2022 · 5 comments · Fixed by #4592
Closed

refetchInterval not working #4584

Willham12 opened this issue Dec 2, 2022 · 5 comments · Fixed by #4592
Labels
bug Something isn't working react-native

Comments

@Willham12
Copy link

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

...

@TkDodo
Copy link
Collaborator

TkDodo commented Dec 2, 2022

provide a reproduction please

@johnanthonyeletto
Copy link

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,
        }
   );

@TkDodo
Copy link
Collaborator

TkDodo commented Dec 3, 2022

what does typeof document yield in react-native please? This is the only change we made:

@TkDodo
Copy link
Collaborator

TkDodo commented Dec 3, 2022

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?

@Willham12
Copy link
Author

Thanks for the quick fix ;D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working react-native
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants