Skip to content

@tanstack/react-query@4.3.4 react-native example does not work - queryFn not being called #4154

Closed
@tomskopek

Description

@tomskopek

Describe the bug

I'm trying to migrate from react-query v3. I couldn't get react-query v4.3.4 to work in my react-native app, so I eventually tried the demo app.

The react-native example provided in the repo also doesn't work.
Specifically, the queryFn doesn't seem to be getting called. You can verify this by noting that console.log in fetchMovies() never gets called.

I downgraded the example app to use react-query@4.0.10, a version I have working in my react web project. I also tried 4.2.3, the last version before 4.3 minor version was released.

Now the console.log in fetchMovies() does get called, as expected.
However, note that now data seems to be returning a function, instead of an array, as I'd expect, so the example repo still is not working out of the box.

Thanks!

Your minimal, reproducible example

https://github.com/TanStack/query/tree/main/examples/react/react-native

Steps to reproduce

Run the expo code example provided in the package, with react-query set to v4.3.4

Expected behavior

As a user, I expect to see a movie list, but I do not.

How often does this bug happen?

No response

Screenshots or Videos

No response

Platform

  • OS - iOS 12.5.1
  • iPhone 13 Pro Max simulator 15.2

react-query version

4.3.4

TypeScript version

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions