react-native
react-native copied to clipboard
The React Native and Unity project integration doesn't seem to work out well.
Description
The React Native and Unity project integration doesn't seem to work out well. When I used ReactRootView to integrate into an existing Unity project, the Component layout was reversed in the vertical direction, like title was originally above and now below, as are other Component s. The same code for newly created projects with XCode.
Version
0.69.5
Output of npx react-native info
System: OS: macOS 12.6 CPU: (8) arm64 Apple M1 Memory: 137.97 MB / 16.00 GB Shell: 5.8.1 - /bin/zsh Binaries: Node: 18.3.0 - /opt/homebrew/bin/node Yarn: 1.22.19 - /opt/homebrew/bin/yarn npm: 8.11.0 - /opt/homebrew/bin/npm Watchman: 2022.06.13.00 - /opt/homebrew/bin/watchman Managers: CocoaPods: 1.11.3 - /opt/homebrew/bin/pod SDKs: iOS SDK: Platforms: DriverKit 21.4, iOS 16.0, macOS 12.3, tvOS 16.0, watchOS 9.0 Android SDK: Not Found IDEs: Android Studio: Not Found Xcode: 14.0.1/14A400 - /usr/bin/xcodebuild Languages: Java: Not Found npmPackages: @react-native-community/cli: Not Found react: ^18.2.0 => 18.2.0 react-native: ^0.69.5 => 0.69.5 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found
Steps to reproduce
Integration with Existing Apps iOS & Unity
Use the code just like the following form
NSURL *jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.bundle?platform=ios"];
RCTRootView *rootView =
[[RCTRootView alloc] initWithBundleURL: jsCodeLocation
moduleName: @"RNHighScores"
initialProperties:
@{
@"scores" : @[
@{
@"name" : @"Alex",
@"value": @"42"
},
@{
@"name" : @"Joel",
@"value": @"10"
}
]
}
launchOptions: nil];
UIViewController *vc = [[UIViewController alloc] init];
vc.view = rootView;
[self presentViewController:vc animated:YES completion:nil];
Snack, code example, screenshot, or link to a repository
Demo running under Unity, wrong position.The Test Component should be above it.
On other items, the correct location.
The React Native and Unity project integration doesn't seem to work out well
Can you link to the documentation you've been using about Unity project integration?
The React Native and Unity project integration doesn't seem to work out well
Can you link to the documentation you've been using about Unity project integration?
I integrated the ReactNative into the Unity project and added the RCTRootView to the UnityView. Use the following document. https://reactnative.dev/docs/integration-with-existing-apps
This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.
This issue was closed because it has been stalled for 7 days with no activity.
Any update on this issue? I meet up with same problem.. looks like flex-start becomes flex-end, also in a unity project