Skip to content

Commit

Permalink
Fix crash on macos when using Layout Animations (#6600)
Browse files Browse the repository at this point in the history
<!-- Thanks for submitting a pull request! We appreciate you spending
the time to work on these changes. Please follow the template so that
the reviewers can easily understand what the code changes affect. -->

## Summary
Previously we were passing a window to function convertPoint, that
accepts only view. It was causing a crash, therefore we should pass the
contentView of the window.
<!-- Explain the motivation for this PR. Include "Fixes #<number>" if
applicable. -->

## Test plan
Tested on several examples:
* Olympic example
* [LA] Basic Layout Animation
* [LA] Entering and Exiting with Layout 
* [LA] Carousel
<!-- Provide a minimal but complete code snippet that can be used to
test out this change along with instructions how to run it and a
description of the expected behavior. -->
  • Loading branch information
Latropos authored Oct 16, 2024
1 parent 4098856 commit ae9702e
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ - (void)makeSnapshotForView:(REAUIView *)view
withOffsetY:(double)offsetY
{
#if TARGET_OS_OSX
REAUIView *mainWindow = UIApplication.sharedApplication.keyWindow;
NSView *mainWindow = UIApplication.sharedApplication.keyWindow.contentView;
#else
REAUIView *mainWindow = RCTKeyWindow();
#endif
Expand Down

0 comments on commit ae9702e

Please sign in to comment.