-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e4a3143
commit bb78cfe
Showing
1 changed file
with
22 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,25 @@ | ||
import { NativeModules, Platform } from 'react-native'; | ||
// import { NativeModules, Platform } from 'react-native'; | ||
|
||
const LINKING_ERROR = | ||
`The package 'react-native-server-component' doesn't seem to be linked. Make sure: \n\n` + | ||
Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) + | ||
'- You rebuilt the app after installing the package\n' + | ||
'- You are not using Expo Go\n'; | ||
// const LINKING_ERROR = | ||
// `The package 'react-native-server-component' doesn't seem to be linked. Make sure: \n\n` + | ||
// Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) + | ||
// '- You rebuilt the app after installing the package\n' + | ||
// '- You are not using Expo Go\n'; | ||
|
||
const ServerComponent = NativeModules.ServerComponent | ||
? NativeModules.ServerComponent | ||
: new Proxy( | ||
{}, | ||
{ | ||
get() { | ||
throw new Error(LINKING_ERROR); | ||
}, | ||
} | ||
); | ||
// const ServerComponent = NativeModules.ServerComponent | ||
// ? NativeModules.ServerComponent | ||
// : new Proxy( | ||
// {}, | ||
// { | ||
// get() { | ||
// throw new Error(LINKING_ERROR); | ||
// }, | ||
// } | ||
// ); | ||
|
||
export function multiply(a: number, b: number): Promise<number> { | ||
return ServerComponent.multiply(a, b); | ||
} | ||
// export function multiply(a: number, b: number): Promise<number> { | ||
// return ServerComponent.multiply(a, b); | ||
// } | ||
|
||
export * from './@types'; | ||
export * from './component'; |