Using useDeferredValue and Suspense unexpectedly shows fallback in ios/android but correctly shows stale state in web #50078
Labels
Needs: Attention
Issues where the author has responded to feedback.
Description
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 an expo snack.
The correct behavior is observed in React Native web. However for android/ios the fallback always shows. For the snack I'm using React Native 0.76.7, which is the default version that a new expo project installs. I've also tested on 0.77.1 but get the same behavior.
In my actual project where I have ios/android folders I've tried explicitly setting newArchEnabled/isConcurrentRootEnabled like some of these older articles suggest, see here. However, the same behavior is observed with that as well.
Steps to reproduce
React Native Version
0.76.7
Affected Platforms
Other (please specify)
Output of
npx @react-native-community/cli info
Stacktrace or Logs
Reproducer
https://snack.expo.dev/@polarwang/reactnative-suspense-usedeferredvalue-bug
Screenshots and Videos
No response
The text was updated successfully, but these errors were encountered: