-
Notifications
You must be signed in to change notification settings - Fork 0
Description
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 PostsTab render tree. However, on iOS, 4 renders happen, synchronously blocking the next render until the slow PostsTab render tree is commited.
Demos
| Web | Android | iOS |
|---|---|---|
use-transition-web.mov |
use-transition-android.mov |
use-transition-ios.mov |
Profiles
Android
Using npx react-devtools, you can see that Android only renders twice.
- Initial Render
ContactTabrender
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.
iOS
On iOS, this example shows 4 renders.
- Initial Render
PostsTabrenderonClickprops change toTabButtonContactTabrender





