Project initialization (npx create-react-native-library)
This commit is contained in:
1
src/__tests__/index.test.tsx
Normal file
1
src/__tests__/index.test.tsx
Normal file
@@ -0,0 +1 @@
|
||||
it.todo('write a test');
|
||||
26
src/index.tsx
Normal file
26
src/index.tsx
Normal file
@@ -0,0 +1,26 @@
|
||||
import {
|
||||
requireNativeComponent,
|
||||
UIManager,
|
||||
Platform,
|
||||
ViewStyle,
|
||||
} from 'react-native';
|
||||
|
||||
const LINKING_ERROR =
|
||||
`The package 'bigbluebutton-mobile-sdk' 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 managed workflow\n';
|
||||
|
||||
type BigbluebuttonMobileSdkProps = {
|
||||
color: string;
|
||||
style: ViewStyle;
|
||||
};
|
||||
|
||||
const ComponentName = 'BigbluebuttonMobileSdkView';
|
||||
|
||||
export const BigbluebuttonMobileSdkView =
|
||||
UIManager.getViewManagerConfig(ComponentName) != null
|
||||
? requireNativeComponent<BigbluebuttonMobileSdkProps>(ComponentName)
|
||||
: () => {
|
||||
throw new Error(LINKING_ERROR);
|
||||
};
|
||||
Reference in New Issue
Block a user