Skip to content

[3.0.0-beta.1] Hook gestures stop working after parent <Activity> changes mode #3965

@SewerynKras

Description

@SewerynKras

Description

If a component that uses one of the new hook gestures is rendered withing the react 19.2's <Activity> and that activity changes mode (goes from hidden to visible) then the gesture will no longer work.

It's worth noting that the regular Gesture.Tap() API works as expected.

This could be related to #3937 as <Activity> also uses display: "none" under the hood, but I couldn't reproduce this bug using the legacy API on Android. I suspect this has something to do with how <Activity> pauses side-effects of hidden components.

Please see the attached gist for a simple example. No snack since no version of expo go has the gesture handler beta installed.

Tested only on Android using expo 55.0.0-preview.9 development build. I don't have an iOS device on hand to verify if it's also affected

Steps to reproduce

(see attached gist for a simple example)

  1. Render a component that uses a hook gesture within an <Activity> with mode="visible"
  2. Change that activity's mode to hidden
  3. Change it back to visible
  4. The gesture will no longer be recognized

A link to a Gist, an Expo Snack or a link to a repository based on this template that reproduces the bug.

https://gist.github.com/SewerynKras/5efae42345c44da40a72419c2f8c8e1f

Gesture Handler version

3.0.0-beta.1

React Native version

0.83.1

Platforms

Android

JavaScript runtime

None

Workflow

Using Expo Prebuild or an Expo development build

Architecture

New Architecture (Fabric)

Build type

None

Device

Real device

Device model

No response

Acknowledgements

Yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    Platform: AndroidThis issue is specific to AndroidRepro providedA reproduction with a snack or repo is provided

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions