-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unexpected useTransition behavior on iOS #1
Comments
Others seem to have this issue on past versions: reactwg/react-native-new-architecture#94 |
Hello @joshuayoes, thank you for the report. You're right, there is an issue with concurrent rendering. |
Thank you for that context @sammy-SC! Does this mean the native scheduler isn't being used across both iOS and Android now? |
I've retested with react-native@0.72.0-rc.3 and it appears that iOS is working as expected now, but Android has regressed back to synchronous rendering behavior. |
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 slowPostsTab
render tree is commited.Demos
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.ContactTab
renderThe "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.
PostsTab
renderonClick
props change toTabButton
ContactTab
renderSee React DevTools profile export for more information.
The text was updated successfully, but these errors were encountered: