fix: Chrome debugger crash caused by incorrect viewTag - #6437
Merged
Conversation
MatiPl01
commented
Aug 21, 2024
MatiPl01
enabled auto-merge
August 21, 2024 15:01
r0h0gg6
pushed a commit
to r0h0gg6/react-native-reanimated
that referenced
this pull request
Jul 28, 2025
…ion#6437) ## Summary The problem was reported in [this](software-mansion#6432) issue and [this](software-mansion#6359) discussion seems to report the same problem. In short, the crash was caused by incorrect check in `_getViewInfo` in `createAnimatedComponent` which assigned the `_component` to the `viewTag` only for web but not for chrome debugger. I replaced `IS_WEB` check with `shouldBeUseWeb`, which also checks whether the current environment is a chrome debugger. ## Test plan - I created a bare app with `npx @react-native-community/cli init ReactNativeDebugger --version 0.75.1` - Installed latest reanimated and downloaded [react-native-debugger](https://github.com/jhen0409/react-native-debugger?tab=readme-ov-file) mentioned in [this](software-mansion#6432) issue - Launched `react-native-debugger` and enabled remote debugging with js, - When I tried to animate component with animated style, I saw the reported crash
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The problem was reported in this issue and this discussion seems to report the same problem.
In short, the crash was caused by incorrect check in
_getViewInfoincreateAnimatedComponentwhich assigned the_componentto theviewTagonly for web but not for chrome debugger. I replacedIS_WEBcheck withshouldBeUseWeb, which also checks whether the current environment is a chrome debugger.Test plan
npx @react-native-community/cli init ReactNativeDebugger --version 0.75.1react-native-debuggerand enabled remote debugging with js,