Skip to content
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

Event callback is not running in ui thread. #2878

Closed
NiuGuohui opened this issue Apr 25, 2024 · 2 comments
Closed

Event callback is not running in ui thread. #2878

NiuGuohui opened this issue Apr 25, 2024 · 2 comments
Labels
Missing repro Platform: Android This issue is specific to Android

Comments

@NiuGuohui
Copy link

Description

I was upgrade to RN0.74 and react-native-gesture-handler@2.16.0. But I found that all event callbacks (such as onBegin, onTouchesDown, onTouchesMove) run on the JS thread.
Now I must wrap each callback function using runOnUI.

Steps to reproduce

  1. declare a variable in js thread.
  2. try to console this variable in onTouchesMove fn body.
  3. you can see that was print normally(But in fact, if it is in the UI thread, it cannot be read).

Snack or a link to a repository

none

Gesture Handler version

2.16.0

React Native version

0.74.0

Platforms

Android

JavaScript runtime

Hermes

Workflow

React Native (without Expo)

Architecture

Fabric (New Architecture)

Build type

Debug mode

Device

Android emulator

Device model

No response

Acknowledgements

Yes

@github-actions github-actions bot added the Platform: Android This issue is specific to Android label Apr 25, 2024
Copy link

Hey! 👋

The issue doesn't seem to contain a minimal reproduction.

Could you provide a snack or a link to a GitHub repository under your username that reproduces the problem?

@m-bert
Copy link
Contributor

m-bert commented Apr 25, 2024

Hi @NiuGuohui! Thanks for reporting this issue! We have already merged fix for this problem. While it wasn't released in 2.16.0, you can expect it to be released by the end of the week.

@m-bert m-bert closed this as completed Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Missing repro Platform: Android This issue is specific to Android
Projects
None yet
Development

No branches or pull requests

2 participants