Open lovegaoshi opened 2 months ago
Hi @lovegaoshi, do you think you could provide us with recordings of how this looks? I'm looking now for differences but cant spot one.
Thank you so much for taking a look @kkafar and sorry for not posting them earlier, here is 3.30.1 with the lag https://github.com/software-mansion/react-native-screens/assets/106490582/6e7926a9-e30f-4c8b-b6fb-bd3b16814d60
And 3.29.0 without lag https://github.com/software-mansion/react-native-screens/assets/106490582/eee9556d-a882-42af-b43f-f685072cad68
There is no code difference other than the dep downgrade; device is pixel7 but also shows on samsung s21
This looks like an issue with screen transitioning and draw ordering - we may need to check if this commit may cause this š
perhaps its android:duration="450" />
?
Yeah, most likely that's because of the transition duration. However, what's even stranger, I can see that on both versions of screens this lag exists (it's shorter on 3.29.0, though). Can you also spot the same artifacts @lovegaoshi?
3.29.0:
3.29.0 (detailed version):
3.30.1:
thank you so much @tboba for the thorough investigation, yes that's what I see as well; now with the pointed out commit it makes sense to me that both have "lags," 29.0 has a smaller "lag" with a 80ms duration and 30.1 is much more noticeable with a 450ms duration. I'll try to patch-package 3.30.1 with a minimum transition duration on my end.
Hi @lovegaoshi! Could you check if installing screens version from this branch: https://github.com/software-mansion/react-native-screens/pull/2110 fixes this issue?
hi @tboba thank you so much for the fix! I tried to patch android:duration into a smaller value but it didnt seem to make a difference on an emulator, yet to try with a real device. Also I tried to install from branch #2110 and I don't think I got it right, it's missing React:
do I just clone, yarn, yarn prepare and cp/link the cloned repo to my node_modules?
ERROR TypeError: Cannot read property 'useState' of null
This error is located at:
in DelayedFreeze
in InnerScreen
in Screen (created by MaybeScreen)
in MaybeScreen (created by Drawer)
in RNSScreenContainer
in ScreenContainer (created by MaybeScreenContainer)
in MaybeScreenContainer (created by Drawer)
in RCTView (created by View)
in View (created by Drawer)
in RCTView (created by View)
in View (created by AnimatedComponent(View))
in AnimatedComponent(View)
in Unknown (created by Drawer)
in RCTView (created by View)
in View (created by AnimatedComponent(View))
in AnimatedComponent(View)
in Unknown (created by PanGestureHandler)
in PanGestureHandler (created by Drawer)
in Drawer (created by DrawerViewBase)
in DrawerViewBase (created by DrawerView)
in RNGestureHandlerRootView (created by GestureHandlerRootView)
in GestureHandlerRootView (created by DrawerView)
in RCTView (created by View)
in View (created by SafeAreaProviderCompat)
in SafeAreaProviderCompat (created by DrawerView)
in DrawerView (created by DrawerNavigator)
in PreventRemoveProvider (created by NavigationContent)
in NavigationContent
in Unknown (created by DrawerNavigator)
in DrawerNavigator (created by AzusaPlayer)
in RCTView (created by View)
in View (created by AzusaPlayer)
in EnsureSingleNavigator
in BaseNavigationContainer
in ThemeProvider
in NavigationContainerInner (created by AzusaPlayer)
in ThemeProvider (created by PaperProvider)
in RCTView (created by View)
in View (created by Portal.Host)
in Portal.Host (created by PaperProvider)
in RCTView (created by View)
in View (created by SafeAreaInsetsContext)
in SafeAreaProviderCompat (created by PaperProvider)
in PaperProvider (created by AzusaPlayer)
in AzusaPlayer (created by App)
in RNCSafeAreaProvider (created by SafeAreaProvider)
in SafeAreaProvider (created by App)
in RCTView (created by View)
in View (created by MainBackground)
in RCTView (created by View)
in View (created by ImageBackground)
in ImageBackground (created by MainBackground)
in MainBackground (created by App)
in RNGestureHandlerRootView (created by GestureHandlerRootView)
in GestureHandlerRootView (created by App)
in App
in RCTView (created by View)
in View (created by AppContainer)
in RCTView (created by View)
in View (created by AppContainer)
in AppContainer
in azusa-player-mobile(RootComponent), js engine: hermes
@lovegaoshi hmm, I believe you need to do yarn prepare
inside the node_modules/react-native-screens, since it's not automated now, because of yarn v4 š
my sincere apologies, I dont seem to get this at all:S
If I clone, yarn, yarn prepare, then cp to node_modules, build succeeds but I got the above (React is null); if I clone, cp to node_modules, yarn, yarn prepare, bob build will not succeed on Failed to build definition files. (tsc fail, below) package.json doesn't include adroid/src in the files entry so I can't do git+ in package.json;
~/Documents/GitHub/azusa-player-mobile/node_modules$ git clone https://github.com/software-mansion/react-native-screens.git
Cloning into 'react-native-screens'...
remote: Enumerating objects: 20613, done.
remote: Counting objects: 100% (8418/8418), done.
remote: Compressing objects: 100% (2318/2318), done.
remote: Total 20613 (delta 6620), reused 7069 (delta 5676), pack-reused 12195
Receiving objects: 100% (20613/20613), 37.38 MiB | 7.88 MiB/s, done.
Resolving deltas: 100% (13085/13085), done.
user@localhost:~/Documents/GitHub/azusa-player-mobile/node_modules/react-native-screens$ git switch @tboba/restore-android-animations
Branch '@tboba/restore-android-animations' set up to track remote branch '@tboba/restore-android-animations' from 'origin'.
Switched to a new branch '@tboba/restore-android-animations'
user@localhost:~/Documents/GitHub/azusa-player-mobile/node_modules/react-native-screens$ git pull
Already up to date.
user@localhost:~/Documents/GitHub/azusa-player-mobile/node_modules/react-native-screens$ yarn; yarn prepare
ā¤ YN0000: Ā· Yarn 4.1.1
ā¤ YN0000: ā Resolution step
ā¤ YN0000: ā Completed
ā¤ YN0000: ā Post-resolution validation
ā¤ YN0002: ā react-native-screens@workspace:. doesn't provide @react-native-community/masked-view (p440d0), requested by @react-navigation/stack.
ā¤ YN0086: ā Some peer dependencies are incorrectly met; run yarn explain peer-requirements <hash> for details, where <hash> is the six-letter p-prefixed code.
ā¤ YN0000: ā Completed
ā¤ YN0000: ā Fetch step
ā¤ YN0000: ā Completed in 0s 732ms
ā¤ YN0000: ā Link step
ā¤ YN0000: ā Completed in 4s 260ms
ā¤ YN0000: Ā· Done with warnings in 5s 384ms
ā¹ Building target commonjs
ā¹ Cleaning up previous build at lib/commonjs
ā¹ Compiling 61 files in src with babel
Browserslist: caniuse-lite is outdated. Please run:
npx update-browserslist-db@latest
Why you should do it regularly: https://github.com/browserslist/update-db#readme
ā Wrote files to lib/commonjs
ā¹ Building target module
ā¹ Cleaning up previous build at lib/module
ā¹ Compiling 61 files in src with babel
ā Wrote files to lib/module
ā¹ Building target typescript
ā¹ Cleaning up previous build at lib/typescript
ā¹ Generating type definitions with tsc
src/components/FullWindowOverlay.tsx:15:13 - error TS2786: 'View' cannot be used as a JSX component.
Its instance type 'View' is not a valid JSX element.
15 return <View {...props} />;
~~~~
@lovegaoshi use patch-package and apply this patch, please note it's for react-native-screens@3.31.1
react-native-screens+3.31.1.patch
@tboba looks good to me, tested on Android simulators from version 8 up to 14
thanks a lot! works on my end, I see the bring forward/backward animation I think I saw in android 12 instead of the sliding one from macs
saw the 3.32.0 update but this issue still lingers :(
Description
Hello!
I'm using @react-navigation/native-stack's createNativeStackNavigator to create stacks of screens. Since I upgraded to react-native-screens to 3.30.1, I noticed a (more) noticeable lag of the previous screen when navigating to the next screen on android; downgrading to 3.29.0 "fixes" this lag. This is quite vague and I have no clue what could be the reason, thanks a lot in advance if anyone wouldnt mind taking a look at it!
Steps to reproduce
build https://github.com/lovegaoshi/azusa-player-mobile/releases/tag/dev-build-2024-04-10 uses 3.30.1. https://github.com/lovegaoshi/azusa-player-mobile/releases/tag/dev-build-2024-04-11 uses 3.29.0. the left hamburger menu -> settings -> navigate to any screen shows it.
Snack or a link to a repository
https://github.com/lovegaoshi/azusa-player-mobile/tree/ee9c096a7bf56b97a415f3b1e363096ed0730163
Screens version
3.30.1/3.29.0
React Native version
0.73.6
Platforms
Android
JavaScript runtime
Hermes
Workflow
React Native (without Expo)
Architecture
Paper (Old Architecture)
Build type
Release mode
Device
Real device
Device model
Samsung S21 (android 14)
Acknowledgements
Yes