-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Reanimated doesn't compile with React Native macOS 0.75 #6501
Comments
Thanks absolute legend! |
I found this is a quick fix when you replace the following lines with these code blocks: Files and Fixes:
|
Hi @Saadnajmi! Thank you for reporting this issue. Was there a specific reason to change A potential solution in our codebase would be to create new type: #if TARGET_OS_OSX
typedef NSDictionary<NSNumber *, RCTPlatformView *> ViewRegistry;
#else
typedef NSDictionary<NSNumber *, RCTUIView *> ViewRegistry;
#endif and then using |
This looks like a dupe of #6421. I did make some quick fixes for reanimated and gesture handler here: https://github.com/hsjoberg/react-native-reanimated/tree/rn75fix But perhaps something like |
@m-bert I was hoping it would be a non-breaking change that just widened the view registry. I assume we can't guarantee only RCTUIView's will be there. But it's true that |
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 I did some testing and it seems React Native Gesture Handler has the same issues with my change, so I'm more likely to revert. |
@m-bert I found the fix! I need to add
I can do that and backport! |
Description
Someone on discord reported that Reanimated doesn't compile with React Native macOS 0.75, specifically on this line:
react-native-reanimated/packages/react-native-reanimated/apple/reanimated/REANodesManager.mm
Line 576 in 1754695
I think the issue is because of this:
In earlier versions React Native macOS, we defined the view registry as
NSDictionary<NSNumber *, RCTUIView *> *viewRegistry
, whereRCTUIView
is a subclass of NSView that overrides and adds some methods for easier compatibility with iOS. In React Native macOS 0.75 (and maybe 0.74?), we changed the definition toNSDictionary<NSNumber *, RCTPlatformView *> *viewRegistry
, whereRCTPlatformView
is simply a typedef of either NSView or UIView.I thought the change would be innocuous since we were widening the scope of what views were accepted into the view registry, but I guess not? Said person on discord can get around the issue by replacing
REAUIView
withRCTPlatformView
wherever there's an error.I'm not entirely sure whether the fix should be React Native macOS reverts the change I described above, or we update Reanimated to use something like
REAPlatformView
. My main concern is whether or not updating Reanimated keeps it backwords compatible with earlier versions of React Native macOS.Steps to reproduce
Try to build a new macOS test app (initialized with
react-native-macos-init
) with Reanimated.Snack or a link to a repository
I'm copy pasta-ing info someone sent me on discord.. so I don't have one yet.
Reanimated version
the latest?
React Native version
0.75
Platforms
macOS
JavaScript runtime
None
Workflow
None
Architecture
None
Build type
None
Device
None
Device model
No response
Acknowledgements
Yes
The text was updated successfully, but these errors were encountered: