React-native-screens: Rerendering parent view causes incorrect swipe animation offset

Created on 13 Nov 2019  路  17Comments  路  Source: software-mansion/react-native-screens

I'm using react-native-appearance to listen to the system appearance change event. When the system appearance changes, all the mounted screens will rerender. With enableScreens called, the parent screen will animate incorrectly on iOS, as the screenshot below.

11573619380_ pic_hd

react-navigation: 4.0.10
react-navigation-stack: 1.10.3
react-navigation-tabs: 2.5.6
react-native-screens: 2.0.0-alpha.8
react-native: 0.61.4
system: iOS 13.2

Most helpful comment

I have possibly the same issue. I can only seem to reproduce it in Release mode. (Edit: reproduced Debug Mode also) Basically I can swipe the screen to the right, creating the gap on the left side. Almost like a drawer that should not exist...

I'm not sure if this is an issue with this repo or react-navigation

IMG_1466

"react-native": "0.60.5",
 "react-native-screens": "^2.0.0-alpha.8",
iOS: 13.1.3

All 17 comments

I have possibly the same issue. I can only seem to reproduce it in Release mode. (Edit: reproduced Debug Mode also) Basically I can swipe the screen to the right, creating the gap on the left side. Almost like a drawer that should not exist...

I'm not sure if this is an issue with this repo or react-navigation

IMG_1466

"react-native": "0.60.5",
 "react-native-screens": "^2.0.0-alpha.8",
iOS: 13.1.3

Having similar issue

Same for me :(

Still having this problem with the latest 2.0.0-alpha.11.

You just need to replace your import { createStackNavigator } from 'react-navigation-stack' with import createNativeStackNavigator from 'react-native-screens/createNativeStackNavigator';. It should resolve your issues (refer to docs https://github.com/kmagiera/react-native-screens#using-native-stack-navigator)

@Mlobaievskyi
There are some technical limitations for implementing some of the stack header options.

I have tried that and break my layouts. More worst :D

@Mlobaievskyi Native stack navigator doesn't support some stack navigation options, I think it's still an experimental feature.

@kmagiera @janicduplessis @osdnk Any solution for this? It's very relevant problem

@mizinin Are you using import createNativeStackNavigator from 'react-native-screens/createNativeStackNavigator'? Solved the issue for me

Using createNativeStackNavigator is not suitable for all cases, since its API is much more restrictive compared to @react-navigation/stack library

The issue seems to be fixed in "2.0.0-alpha.23"

I am using "react-navigation-stack": "^2.0.13",

I'm still using react-navigation-stack 1.10.3, the 2.0.0-alpha.23 version seems not solving this issue for me.

I currently can't upgrade react-navigation-stack to 2.0.13 version 'cause it breaks my screen animations and need some rework. I'll check if 2.0.0-alpha.23 works with 2.0.13 once I upgrade it.

Issue seems to be fixed for me as well, using these versions:

   "react-native-screens": "^2.0.0-alpha.23",
    "react-native": "0.61.5",
    "react-navigation": "^4.0.10",
    "react-navigation-stack": "^2.0.15",

Does the issue still exist in the newest version? @ouabing @pepf ? Or can I close it?

The issue seemed to be solved using this config :)

Ok, so I am closing it. Feel free to comment if the issue still persists for someone.

I've already migrated to react-navigation v5 and react-navigation-stack v2, no more this issue so far.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

thomasgosse picture thomasgosse  路  4Comments

chai86 picture chai86  路  3Comments

jeveloper picture jeveloper  路  5Comments

iDuuck picture iDuuck  路  5Comments

bartzy picture bartzy  路  3Comments