Skip to content

Using useDeferredValue and Suspense unexpectedly shows fallback in React Native ios/android but correctly shows stale state in React/React Native Web #8819

Closed
@andrew-wang-polar

Description

@andrew-wang-polar

Describe the bug

I'm following the examples from React on using useDeferredValue and Suspense to show a stale state. The correct behavior should be to show the fallback only on the first load, and then on subsequent queries (e.g. when typing in the search box or incrementing counter in the examples) show a stale state until new data is loaded (which then should replace the stale state).

I've included expo snack for React Native and stackblitz for React.

The correct behavior is observed in React (I tested both React 18 + 19) and React Native web. However for React Native android/ios the fallback always shows. For React Native the snack uses React Native 0.77.1. I believe the new architecture is enabled by default, but I have also tried explicitly setting newArchEnabled/isConcurrentRootEnabled like some of these older articles suggest, see here. However, the same behavior is observed.

Your minimal, reproducible example

https://snack.expo.dev/@polarwang/suspense-usedeferredvalue-bug?platform=ios

Steps to reproduce

  1. Go to this expo snack for React Native android/ios/web example
  2. Go to this stackblitz for React example

Expected behavior

Described above:
The correct behavior should be to show the fallback only on the first load, and then on subsequent queries (e.g. when typing in the search box or incrementing counter in the examples) show a stale state until new data is loaded (which then should replace the stale state)

How often does this bug happen?

Every time

Screenshots or Videos

No response

Platform

  • OS: ios, android

Tanstack Query adapter

react-query

TanStack Query version

v5.68.0

TypeScript version

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions