Open hsjoberg opened 4 weeks ago
It seems like NSView is being expected somewhere instead of REAUIView (which is a typedef of RCTUIView for macOS, not NSView), but I cannot quite figure out where.
The issue is essentially that RCTViewManagerUIBlock
that's being used as arg to reanimated_addUIBlock()
expects UIView
in react-native and NSView
in react-native-macos, but reanimated's REAUIView
is typedef'd as RCTUIView
on macos. It's therefore incorrectly used here: https://github.com/software-mansion/react-native-reanimated/blob/c7f4b5f9b1157a31da289f9065961ac526f96bf1/packages/react-native-reanimated/apple/reanimated/LayoutReanimation/REASwizzledUIManager.mm#L374-L376
RCTViewManagerUIBlock
:
react-native (iOS): https://github.com/facebook/react-native/blob/ade863a48cd78039dd68e7176e339cdaca3b0f74/packages/react-native/React/Views/RCTViewManager.h#L22
react-native-macos: https://github.com/microsoft/react-native-macos/blob/042cd6c36b23c21d20de628bc9756793e01ce282/packages/react-native/React/Views/RCTViewManager.h#L22 (RCTPlatformView in turn defined as NSView: https://github.com/microsoft/react-native-macos/blob/042cd6c36b23c21d20de628bc9756793e01ce282/packages/react-native/React/Base/RCTUIKit.h#L382).
Okay, I've quick & dirty fixes for react-native-reanimated and react-native-gesture-handler here:
https://github.com/hsjoberg/react-native-reanimated/tree/rn75fix https://github.com/hsjoberg/react-native-gesture-handler/tree/rn75fix
Just using #ifdef
to output NSView or UIView.
I don't know the proper solution here but I'm happy to make a PR if someone would give some directions.
Description
Hi. When trying to build react-native-reanimated with react-native-macos 0.74.1, the following syntax error is encountered in REASizzledManager.mm#L235 and in other places.
Simply changing
REAUIView
toNSView
everywhere where the compiler complains seems to fix the issue. But I don't know react-native-reanimated's inner workings well enough to understand if this is a sane approach. If yes, I can submit a PR.Also, react-native-gesture-handler has a similar issue as this one. I could file a bug report there too if needed.
Steps to reproduce
Try to build the demo project to see the issue.
Due to an unrelated issue in react-native-macos 0.74.1 https://github.com/microsoft/react-native-macos/issues/2165, you may have to clear out the build phase script
[CP-User] [RN]Check rncore
in theReact-Fabric
pod before building.Snack or a link to a repository
https://github.com/hsjoberg/rnmacos74/tree/reanimated (
reanimated
branch)Reanimated version
3.15.0
React Native version
0.74.1
Platforms
macOS
JavaScript runtime
JSC
Workflow
React Native
Architecture
Paper (Old Architecture)
Build type
None
Device
Real device
Device model
No response
Acknowledgements
Yes