react-native-reanimated icon indicating copy to clipboard operation
react-native-reanimated copied to clipboard

screen freezes on ios and no touch support on Layout with entering or exiting animation

Open geoapostolidis opened this issue 3 years ago • 26 comments

Description

On ios the screen freezes on Layout with entering or exiting animation. When i navigate to the page that has layout on navigate back then the screen freezes and has no touch support. The problem is that there is no error in console in order to debug it.

Expected behavior

Actual behavior & steps to reproduce

Snack or minimal code example

import React, { Component } from 'react';
import Animated, { SlideInLeft, SlideOutLeft } from "react-native-reanimated";

class Search extends Component {

  render(){

    return (
      <Animated.View style={{flex: 1}} entering={SlideInLeft} exiting={SlideOutLeft}>        
      </Animated.View>
    );
  }
}

export default Search

Package versions

i have these packages installed

"@react-navigation/native": "^6.0.11", "@react-navigation/stack": "^6.2.2", "react": "18.0.0", "react-native": "0.69.1", "react-native-reanimated": "^2.9.1"

Affected platforms

  • [ ] Android
  • [x] iOS
  • [ ] Web

geoapostolidis avatar Jul 14 '22 11:07 geoapostolidis

related to https://github.com/software-mansion/react-native-reanimated/issues/3124

ddikodroid avatar Jul 22 '22 23:07 ddikodroid

Experiencing same issue

Tauka avatar Jul 27 '22 10:07 Tauka

For me, all I did is just an import Animated from 'react-native-reanimated'. When I go to a screen and go back, the screen is not responding to touch/scroll. The screen is still functioning properly, but you simply can't do anything. No error, no log, nothing. Because the problem occurs when navigating and react-navigation does use react-native-reanimated, so I think it's incompatibility with react-navigation

react-native-reanimated: 2.9.1 @react-navigation/drawer: 6.4.3 @react-navigation/native: 6.0.11 @react-navigation/stack: 6.2.2 react-native-screens: 3.15.0

anhnch avatar Aug 01 '22 04:08 anhnch

Removing GestureHandler from react-native-gesture-handler fixed freezes for me. Read it from here: https://github.com/software-mansion/react-native-reanimated/issues/3331

Tauka avatar Aug 11 '22 05:08 Tauka

For me, all I did is just an import Animated from 'react-native-reanimated'. When I go to a screen and go back, the screen is not responding to touch/scroll. The screen is still functioning properly, but you simply can't do anything. No error, no log, nothing. Because the problem occurs when navigating and react-navigation does use react-native-reanimated, so I think it's incompatibility with react-navigation

react-native-reanimated: 2.9.1 @react-navigation/drawer: 6.4.3 @react-navigation/native: 6.0.11 @react-navigation/stack: 6.2.2 react-native-screens: 3.15.0

Same problem here. Did you find any solutions?

amin79 avatar Aug 16 '22 20:08 amin79

@Tauka Can you explain what you did, please?

AhmadHoranieh avatar Aug 17 '22 10:08 AhmadHoranieh

Is there a workaround or ETA on a fix for this?

entangledloops avatar Sep 30 '22 18:09 entangledloops

Thanks so much for creating this issue, it took me a while to even know what’s causing the freeze.

lurdharry avatar Oct 24 '22 20:10 lurdharry

@AhmadHoranieh Instead of using GestureHandler from react-native-gesture-handler, I used PanGestureHandler

Tauka avatar Oct 31 '22 07:10 Tauka

@AhmadHoranieh Instead of using GestureHandler from react-native-gesture-handler, I used PanGestureHandler

This works for me too, but it's not ideal since PanGestureHandler is using the old API which is no longer maintained. Any news on this issue?

aLemonFox avatar Nov 29 '22 08:11 aLemonFox

Any updates here?

svenngronbeck avatar Jan 11 '23 12:01 svenngronbeck

I am facing this issue too

vanenshi avatar Jan 27 '23 16:01 vanenshi

Same problem I just spent half a day trying to figure this out.

reanimated v2.14.0 react-native v0.70.5

and just using fades:

<Animated.View
      key={"uniqueKey"}
      entering={FadeIn.duration(300)}
      exiting={FadeOut.duration(300)}
    >
      {...}
</Animated.View>

As soon as I hit the back button and leave this screen the layout is frozen and I need to reload the app

Lakston avatar Mar 03 '23 14:03 Lakston

Also experiencing this problem, after navigating to a screen, the screen generally works fine but the gesture handler is frozen and requires a hot reload to kick in. Unsure if this happens in production.

I am using GestureDetector with Gesture.Pan()

lewisd1996 avatar Mar 09 '23 16:03 lewisd1996

Also experiencing this issue - not even using react-native-gesture-handler. Screen becomes unresponsive to touch after the screen containing the layout transitions is popped from stack navigator

pelayomartinez avatar Mar 12 '23 12:03 pelayomartinez

resolve for me after update to 3.2.0 version

kirbi96 avatar Mar 14 '23 10:03 kirbi96

do you mean 3.0.2 ?

I tried to update, but upgrading reanimated breaks the async storage lib apparently, see this issue, so I'm stuck, cant use the pre made animations on 2.X and can not upgrade to 3.X because it breaks our app.

Lakston avatar Apr 04 '23 13:04 Lakston

Having the same issues weirdly after installing firebase as a dependency.

t0ma5h avatar Apr 06 '23 07:04 t0ma5h

@t0ma5h Did you manage to get it fixed? I'm having the same problem after adding firebase as well. Not sure how they are related though.

filippobarcellos avatar Apr 25 '23 12:04 filippobarcellos

Same problem here. Does someone solved this problem?

jimmy-chiang avatar May 07 '23 14:05 jimmy-chiang

Recently encountered this issue with reanimated v2. I can confirm that with reanimated 3.1.0, @react-navigation/native 6.1.6 and @react-navigation/stack 6.3.16 screens are responsive again. I can't relate to AsyncStorage issue as I haven't tested that, but even if that was the case having responsive screens again is much more important.

MacPiston avatar May 29 '23 15:05 MacPiston

@filippobarcellos yeah, upgraded reanimated to 3.1.0. Be sure to reset the metro cache after you update 👌

t0ma5h avatar May 29 '23 15:05 t0ma5h

Recently encountered this issue with reanimated v2. I can confirm that with reanimated 3.1.0, @react-navigation/native 6.1.6 and @react-navigation/stack 6.3.16 screens are responsive again. I can't relate to AsyncStorage issue as I haven't tested that, but even if that was the case having responsive screens again is much more important.

Well since not being able to access the async storage completely breaks our app, it feels more important to have a fix for that first !

Lakston avatar May 30 '23 07:05 Lakston

Recently encountered this issue with reanimated v2. I can confirm that with reanimated 3.1.0, @react-navigation/native 6.1.6 and @react-navigation/stack 6.3.16 screens are responsive again. I can't relate to AsyncStorage issue as I haven't tested that, but even if that was the case having responsive screens again is much more important.

Well since not being able to access the async storage completely breaks our app, it feels more important to have a fix for that first !

why don't you use mmkv instead?

ddikodroid avatar May 30 '23 08:05 ddikodroid

looks like that the reason is in gesture, try to use working for me on android using react-navigation and the gesture handler HOC

AppRegistry.registerComponent(appName, () => gestureHandlerRootHOC(appRoot));

instead of <GestureHandlerRootView>

Ashalbulk avatar Jun 03 '23 19:06 Ashalbulk