Commit 247f763e authored by Wei Han's avatar Wei Han

example has JSX working

parent 9a661480
...@@ -20,6 +20,8 @@ Pod::Spec.new do |s| ...@@ -20,6 +20,8 @@ Pod::Spec.new do |s|
s.vendored_frameworks = "ios/QmsPluginFramework.xcframework" s.vendored_frameworks = "ios/QmsPluginFramework.xcframework"
s.dependency "React-Core" s.dependency "React-Core"
s.dependency "ReactCommon"
s.dependency "React-Codegen"
s.pod_target_xcconfig = { s.pod_target_xcconfig = {
"DEFINES_MODULE" => "YES", "DEFINES_MODULE" => "YES",
......
import React, { useEffect } from 'react'; import React, { useEffect } from 'react';
import { StatusBar, useColorScheme, SafeAreaView } from 'react-native'; import { StatusBar, useColorScheme, SafeAreaView, View } from 'react-native';
import { showPluginUI } from 'QmsPlugin'; // import { showPluginUI, QmsDashboardView } from 'QmsPlugin';
import { QmsDashboardView } from 'QmsPlugin';
function App() { function App() {
const isDarkMode = useColorScheme() === 'dark'; const isDarkMode = useColorScheme() === 'dark';
useEffect(() => { // useEffect(() => {
console.log('🚀 Launching plugin UI immediately...'); // console.log('🚀 Launching plugin UI immediately...');
try { // try {
showPluginUI(); // showPluginUI();
} catch (e) { // } catch (e) {
console.error('❌ Error launching plugin UI:', e); // console.error('❌ Error launching plugin UI:', e);
} // }
}, []); // }, []);
return ( return (
<SafeAreaView> <SafeAreaView>
<StatusBar barStyle={isDarkMode ? 'light-content' : 'dark-content'} /> <StatusBar barStyle={isDarkMode ? 'light-content' : 'dark-content'} />
<View style={{ flex: 1 }}>
<QmsDashboardView style={{ flex: 1 }} />
</View>
</SafeAreaView> </SafeAreaView>
); );
} }
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
/* Begin PBXBuildFile section */ /* Begin PBXBuildFile section */
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
44006126336D83DB220E7214 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB81A68108700A75B9A /* PrivacyInfo.xcprivacy */; }; 44006126336D83DB220E7214 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB81A68108700A75B9A /* PrivacyInfo.xcprivacy */; };
712AE726B1EDFA0353239FF4 /* libPods-example.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 89CD3CCA1A313A66796774B0 /* libPods-example.a */; }; 5C7C7888B2763DDB537944FB /* libPods-example.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D74587F939203677C6032281 /* libPods-example.a */; };
761780ED2CA45674006654EE /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 761780EC2CA45674006654EE /* AppDelegate.swift */; }; 761780ED2CA45674006654EE /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 761780EC2CA45674006654EE /* AppDelegate.swift */; };
81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; }; 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; };
/* End PBXBuildFile section */ /* End PBXBuildFile section */
...@@ -21,9 +21,9 @@ ...@@ -21,9 +21,9 @@
13B07FB81A68108700A75B9A /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = PrivacyInfo.xcprivacy; path = example/PrivacyInfo.xcprivacy; sourceTree = "<group>"; }; 13B07FB81A68108700A75B9A /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = PrivacyInfo.xcprivacy; path = example/PrivacyInfo.xcprivacy; sourceTree = "<group>"; };
761780EC2CA45674006654EE /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = AppDelegate.swift; path = example/AppDelegate.swift; sourceTree = "<group>"; }; 761780EC2CA45674006654EE /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = AppDelegate.swift; path = example/AppDelegate.swift; sourceTree = "<group>"; };
81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = example/LaunchScreen.storyboard; sourceTree = "<group>"; }; 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = example/LaunchScreen.storyboard; sourceTree = "<group>"; };
89CD3CCA1A313A66796774B0 /* libPods-example.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-example.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 97D3B4D39E2B400BB6CD8948 /* Pods-example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-example.release.xcconfig"; path = "Target Support Files/Pods-example/Pods-example.release.xcconfig"; sourceTree = "<group>"; };
AA47F8600CDF5615C68BB121 /* Pods-example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-example.release.xcconfig"; path = "Target Support Files/Pods-example/Pods-example.release.xcconfig"; sourceTree = "<group>"; }; B95376DB92E5F5D667A3EE8C /* Pods-example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-example.debug.xcconfig"; path = "Target Support Files/Pods-example/Pods-example.debug.xcconfig"; sourceTree = "<group>"; };
CAC784BC6AE487F1F44322C4 /* Pods-example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-example.debug.xcconfig"; path = "Target Support Files/Pods-example/Pods-example.debug.xcconfig"; sourceTree = "<group>"; }; D74587F939203677C6032281 /* libPods-example.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-example.a"; sourceTree = BUILT_PRODUCTS_DIR; };
ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; }; ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
/* End PBXFileReference section */ /* End PBXFileReference section */
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
isa = PBXFrameworksBuildPhase; isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
712AE726B1EDFA0353239FF4 /* libPods-example.a in Frameworks */, 5C7C7888B2763DDB537944FB /* libPods-example.a in Frameworks */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
ED297162215061F000B7C4FE /* JavaScriptCore.framework */, ED297162215061F000B7C4FE /* JavaScriptCore.framework */,
89CD3CCA1A313A66796774B0 /* libPods-example.a */, D74587F939203677C6032281 /* libPods-example.a */,
); );
name = Frameworks; name = Frameworks;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -92,8 +92,8 @@ ...@@ -92,8 +92,8 @@
BBD78D7AC51CEA395F1C20DB /* Pods */ = { BBD78D7AC51CEA395F1C20DB /* Pods */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
CAC784BC6AE487F1F44322C4 /* Pods-example.debug.xcconfig */, B95376DB92E5F5D667A3EE8C /* Pods-example.debug.xcconfig */,
AA47F8600CDF5615C68BB121 /* Pods-example.release.xcconfig */, 97D3B4D39E2B400BB6CD8948 /* Pods-example.release.xcconfig */,
); );
path = Pods; path = Pods;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -105,13 +105,13 @@ ...@@ -105,13 +105,13 @@
isa = PBXNativeTarget; isa = PBXNativeTarget;
buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "example" */; buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "example" */;
buildPhases = ( buildPhases = (
E1F13527B09D8BBE28BB41A2 /* [CP] Check Pods Manifest.lock */, 1AC50A012F321C74340135C6 /* [CP] Check Pods Manifest.lock */,
13B07F871A680F5B00A75B9A /* Sources */, 13B07F871A680F5B00A75B9A /* Sources */,
13B07F8C1A680F5B00A75B9A /* Frameworks */, 13B07F8C1A680F5B00A75B9A /* Frameworks */,
13B07F8E1A680F5B00A75B9A /* Resources */, 13B07F8E1A680F5B00A75B9A /* Resources */,
00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */, 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */,
563A8AABF32F40EAA3E56CC8 /* [CP] Embed Pods Frameworks */, E8C958D1F83ABEF9914FCE5F /* [CP] Embed Pods Frameworks */,
A352AC6779C347D6263FC671 /* [CP] Copy Pods Resources */, 54B1B9DF69523B7F550C3320 /* [CP] Copy Pods Resources */,
); );
buildRules = ( buildRules = (
); );
...@@ -183,24 +183,29 @@ ...@@ -183,24 +183,29 @@
shellPath = /bin/sh; shellPath = /bin/sh;
shellScript = "set -e\n\nWITH_ENVIRONMENT=\"$REACT_NATIVE_PATH/scripts/xcode/with-environment.sh\"\nREACT_NATIVE_XCODE=\"$REACT_NATIVE_PATH/scripts/react-native-xcode.sh\"\n\n/bin/sh -c \"$WITH_ENVIRONMENT $REACT_NATIVE_XCODE\"\n"; shellScript = "set -e\n\nWITH_ENVIRONMENT=\"$REACT_NATIVE_PATH/scripts/xcode/with-environment.sh\"\nREACT_NATIVE_XCODE=\"$REACT_NATIVE_PATH/scripts/react-native-xcode.sh\"\n\n/bin/sh -c \"$WITH_ENVIRONMENT $REACT_NATIVE_XCODE\"\n";
}; };
563A8AABF32F40EAA3E56CC8 /* [CP] Embed Pods Frameworks */ = { 1AC50A012F321C74340135C6 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase; isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
); );
inputFileListPaths = ( inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-frameworks-${CONFIGURATION}-input-files.xcfilelist",
); );
name = "[CP] Embed Pods Frameworks"; inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = ( outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-frameworks-${CONFIGURATION}-output-files.xcfilelist", );
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-example-checkManifestLockResult.txt",
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh; shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-frameworks.sh\"\n"; shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0; showEnvVarsInLog = 0;
}; };
A352AC6779C347D6263FC671 /* [CP] Copy Pods Resources */ = { 54B1B9DF69523B7F550C3320 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase; isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
...@@ -217,26 +222,21 @@ ...@@ -217,26 +222,21 @@
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-resources.sh\"\n"; shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-resources.sh\"\n";
showEnvVarsInLog = 0; showEnvVarsInLog = 0;
}; };
E1F13527B09D8BBE28BB41A2 /* [CP] Check Pods Manifest.lock */ = { E8C958D1F83ABEF9914FCE5F /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase; isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
); );
inputFileListPaths = ( inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-frameworks-${CONFIGURATION}-input-files.xcfilelist",
); );
inputPaths = ( name = "[CP] Embed Pods Frameworks";
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = ( outputFileListPaths = (
); "${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-frameworks-${CONFIGURATION}-output-files.xcfilelist",
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-example-checkManifestLockResult.txt",
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh; shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-frameworks.sh\"\n";
showEnvVarsInLog = 0; showEnvVarsInLog = 0;
}; };
/* End PBXShellScriptBuildPhase section */ /* End PBXShellScriptBuildPhase section */
...@@ -255,7 +255,7 @@ ...@@ -255,7 +255,7 @@
/* Begin XCBuildConfiguration section */ /* Begin XCBuildConfiguration section */
13B07F941A680F5B00A75B9A /* Debug */ = { 13B07F941A680F5B00A75B9A /* Debug */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
baseConfigurationReference = CAC784BC6AE487F1F44322C4 /* Pods-example.debug.xcconfig */; baseConfigurationReference = B95376DB92E5F5D667A3EE8C /* Pods-example.debug.xcconfig */;
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
...@@ -283,7 +283,7 @@ ...@@ -283,7 +283,7 @@
}; };
13B07F951A680F5B00A75B9A /* Release */ = { 13B07F951A680F5B00A75B9A /* Release */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
baseConfigurationReference = AA47F8600CDF5615C68BB121 /* Pods-example.release.xcconfig */; baseConfigurationReference = 97D3B4D39E2B400BB6CD8948 /* Pods-example.release.xcconfig */;
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
......
...@@ -142,33 +142,6 @@ ...@@ -142,33 +142,6 @@
}); });
[self.view addSubview:_headerView]; [self.view addSubview:_headerView];
// UIButton *backButton = [UIButton buttonWithType:UIButtonTypeSystem];
// backButton.translatesAutoresizingMaskIntoConstraints = NO;
// UIImage *backImage = [[UIImage systemImageNamed:@"chevron.left"] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
// [backButton setImage:backImage forState:UIControlStateNormal];
// backButton.tintColor = [UIColor whiteColor];
// [backButton addTarget:self action:@selector(handleBackButtonTapped) forControlEvents:UIControlEventTouchUpInside];
// [self.view addSubview:backButton];
// UIButton *menuButton = [UIButton buttonWithType:UIButtonTypeSystem];
// menuButton.translatesAutoresizingMaskIntoConstraints = NO;
// UIImage *menuImage = [[UIImage systemImageNamed:@"line.3.horizontal"] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
// [menuButton setImage:menuImage forState:UIControlStateNormal];
// menuButton.tintColor = [UIColor whiteColor];
// [menuButton addTarget:self action:@selector(handleMenuButtonTapped) forControlEvents:UIControlEventTouchUpInside];
// [self.view addSubview:menuButton];
// [NSLayoutConstraint activateConstraints:@[
// [backButton.leadingAnchor constraintEqualToAnchor:self.view.leadingAnchor constant:8],
// [backButton.topAnchor constraintEqualToAnchor:self.view.safeAreaLayoutGuide.topAnchor constant:4],
// [backButton.widthAnchor constraintEqualToConstant:44],
// [backButton.heightAnchor constraintEqualToConstant:44],
//
// [menuButton.trailingAnchor constraintEqualToAnchor:self.view.trailingAnchor constant:-8],
// [menuButton.topAnchor constraintEqualToAnchor:self.view.safeAreaLayoutGuide.topAnchor constant:4],
// [menuButton.widthAnchor constraintEqualToConstant:44],
// [menuButton.heightAnchor constraintEqualToConstant:44],
// ]];
} }
- (void)handleBackButtonTapped { - (void)handleBackButtonTapped {
......
#import <React/RCTViewManager.h>
#import <QmsPluginFramework/QmsPluginFramework.h>
#import <QmsPluginFramework/QmsPlugin.h>
@interface QmsDashboardView : UIView
@property (nonatomic, strong) UIViewController *dashboardVC;
@property (nonatomic, assign) BOOL didSetupVC;
@end
@implementation QmsDashboardView
- (instancetype)initWithFrame:(CGRect)frame {
if (self = [super initWithFrame:frame]) {
_dashboardVC = [QmsPluginUI makeViewController];
_didSetupVC = NO;
_dashboardVC.view.backgroundColor = [UIColor whiteColor];
}
return self;
}
- (void)didMoveToWindow {
[super didMoveToWindow];
if (self.window && !_didSetupVC) {
UIViewController *parentVC = [UIApplication sharedApplication].keyWindow.rootViewController;
if (parentVC) {
[parentVC addChildViewController:_dashboardVC];
_dashboardVC.view.frame = parentVC.view.bounds; // Force full screen
_dashboardVC.view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
[parentVC.view addSubview:_dashboardVC.view]; // Add directly to root VC
[_dashboardVC didMoveToParentViewController:parentVC];
_didSetupVC = YES;
}
}
}
@end
@interface QmsDashboardViewManager : RCTViewManager
@end
@implementation QmsDashboardViewManager
RCT_EXPORT_MODULE(QmsDashboardView)
- (UIView *)view {
return [[QmsDashboardView alloc] init];
}
@end
...@@ -24,20 +24,6 @@ RCT_EXPORT_MODULE() ...@@ -24,20 +24,6 @@ RCT_EXPORT_MODULE()
return self; return self;
} }
- (NSNumber *)sum:(double)a b:(double)b {
NSLog(@"[QmsPlugin] sum called with a=%f, b=%f", a, b);
NSNumber *result = [QmsPluginFunc sumA:a withB:b];
NSLog(@"[QmsPlugin] sum result = %@", result);
return result;
}
// Wraps the C function QmsPluginMultiply
- (NSNumber *)multiply:(double)a b:(double)b {
NSLog(@"[QmsPlugin] multiply called with a=%f, b=%f", a, b);
NSNumber *result = [QmsPluginFunc multiplyA:a withB:b];
NSLog(@"[QmsPlugin] multiply result = %@", result);
return result;
}
// Wraps the C function QmsPluginMakeViewController // Wraps the C function QmsPluginMakeViewController
- (void)showPluginUI { - (void)showPluginUI {
NSLog(@"[QmsPlugin] showPluginUI CALLED from JS"); NSLog(@"[QmsPlugin] showPluginUI CALLED from JS");
......
// src/NativeQmsPlugin.tsx
import { TurboModuleRegistry, type TurboModule } from 'react-native'; import { TurboModuleRegistry, type TurboModule } from 'react-native';
export interface Spec extends TurboModule { export interface Spec extends TurboModule {
multiply(a: number, b: number): number;
sum(a: number, b: number): number;
showPluginUI(): void; showPluginUI(): void;
} }
......
// src/QmsDashboardView.tsx
import React from 'react';
import { requireNativeComponent } from 'react-native';
import type { ViewStyle } from 'react-native';
type Props = {
style?: ViewStyle;
};
const NativeQmsDashboardView = requireNativeComponent<Props>('QmsDashboardView');
export const QmsDashboardView: React.FC<Props> = (props) => {
return <NativeQmsDashboardView {...props} />;
};
import QmsPlugin from './NativeQmsPlugin'; import QmsPlugin from './NativeQmsPlugin';
export { QmsDashboardView } from './QmsDashboardView';
function multiply(a: number, b: number): number { export function showPluginUI(): void {
return QmsPlugin.multiply(a, b);
}
function sum(a: number, b: number): number {
return QmsPlugin.sum(a, b);
}
function showPluginUI(): void {
QmsPlugin.showPluginUI(); QmsPlugin.showPluginUI();
} }
export default { // export default {
multiply, // showPluginUI,
sum, // QmsDashboardView,
showPluginUI, // };
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment