Replies: 2 comments 1 reply
-
Hi everyone adding to @Almouro's findings, I was experimenting with React18 features like startTransition:
useDeferredValue:
Reactreact-uDV.mp4React Native using uDVreact-native-uDV.mp4React Native not using uDVreact-native-no-uDV.mp4Inspiration for the above example took from this sandbox available on react's website suspense with startTransition:
Note the Loading the app... fallback component that is not visible in React but is visible in React Native Reactreact-suspense.mp4React Nativereact-native-suspense.mp4Inspiration for the above example took from this sandbox available on react's website More resources: |
Beta Was this translation helpful? Give feedback.
-
Adding to this discussion: as of I've created a reproduction repository here: https://github.com/joshuayoes/use-transition-react-native-example This repository implements the React docs example of the useTransition hook in React Native on version 0.72.0-rc.1. This demo tap the Posts (slow) button and then the Contacts button. According the docs, tapping the Contacts button should show the ContactTab view on the next render and skip committing the render of the PostsTab view. On Web and Android, only 2 renders happen, skipping the slow Demos
ProfilesAndroidUsing
The "Posts (slow)" view is not committed to the render tree because the "Contact" view finishes rendering first. See React DevTools profile export for more information. iOSOn iOS, this example shows 4 renders.
|
Beta Was this translation helpful? Give feedback.
-
Hi,
I was trying to play with the new architecture and react 18 concurrent features, namely
startTransition
however, weirdly I'm not seeing any benefit, while the same code works really well on the web.Apologies if I've missed something completely obvious! I did see
Running "FabricEnabled" with {"fabric":true,"initialProps":{"concurrentRoot":true},"rootTag":1}
in my packager logs.Here's the same code running on a release APK (available here and a react-native-web version.
Both on the same device (high end Android device Samsung S10 Android 12)
2022-11-02.18-26-59.mp4
Here's the code:
Beta Was this translation helpful? Give feedback.
All reactions