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

Fix animations not running when Chrome Debugger is attached #4568

Merged
merged 1 commit into from
Jun 16, 2023

Conversation

tomekzaw
Copy link
Member

Summary

This PR fixes a bug in v3 which prevents animations from running when Chrome Debugger is attached (or, in general, when web implementation of Reanimated is used). Originally reported by @coayscue.

Test plan

In order to reproduce the issue, you can simply force use web implementation in PlatformChecker.ts:

 export function isChromeDebugger(): boolean {
-  return !(global as any).nativeCallSyncHook || (global as any).__REMOTEDEV__;
+  return true;
 }

When testing gesture-based examples, you will also need to make this change in gesture.ts:

 export function isRemoteDebuggingEnabled(): boolean {
   // react-native-reanimated checks if in remote debugging in the same way
   // @ts-ignore global is available but node types are not included
-  return !(global as any).nativeCallSyncHook || (global as any).__REMOTEDEV__;
+  return true;
 }

@tomekzaw tomekzaw changed the title Fix animations when Chrome Debugger is attached Fix animations not running when Chrome Debugger is attached Jun 14, 2023
@coayscue
Copy link

This works!

@tomekzaw tomekzaw added this pull request to the merge queue Jun 16, 2023
Merged via the queue into main with commit fbea5dd Jun 16, 2023
1 check passed
@tomekzaw tomekzaw deleted the @tomekzaw/fix-animations-chrome-debugger branch June 16, 2023 10:15
Latropos pushed a commit that referenced this pull request Jun 20, 2023
## Summary

This PR fixes a bug in v3 which prevents animations from running when
Chrome Debugger is attached (or, in general, when web implementation of
Reanimated is used). Originally reported by @coayscue.

## Test plan

In order to reproduce the issue, you can simply force use web
implementation in `PlatformChecker.ts`:

```diff
 export function isChromeDebugger(): boolean {
-  return !(global as any).nativeCallSyncHook || (global as any).__REMOTEDEV__;
+  return true;
 }
```

When testing gesture-based examples, you will also need to make this
change in `gesture.ts`:

```diff
 export function isRemoteDebuggingEnabled(): boolean {
   // react-native-reanimated checks if in remote debugging in the same way
   // @ts-ignore global is available but node types are not included
-  return !(global as any).nativeCallSyncHook || (global as any).__REMOTEDEV__;
+  return true;
 }
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants