Skip to content

Commit e557727

Browse files
feat: make jsBundleSource mandatory
1 parent e71b302 commit e557727

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

packages/react-native-sandbox/README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,16 @@ import SandboxReactNativeView from '@callstack/react-native-sandbox';
4444

4545
### Component Props
4646

47-
| Prop | Type | Required | Description |
48-
|------|------|----------|-------------|
49-
| `moduleName` | `string` | | Name of the React Native module to load |
50-
| `jsBundleSource` | `string` | | Path or URL to JavaScript bundle |
51-
| `initialProperties` | `object` | | Initial props for the sandboxed app |
52-
| `launchOptions` | `object` | | Launch configuration options |
53-
| `allowedTurboModules` | `string[]` | | Additional TurboModules to allow |
54-
| `onMessage` | `function` | | Callback for messages from sandbox |
55-
| `onError` | `function` | | Callback for sandbox errors |
56-
| `style` | `ViewStyle` | | Container styling |
47+
| Prop | Type | Required | Default | Description |
48+
|------|------|----------|---------|-------------|
49+
| `moduleName` | `string` | :ballot_box_with_check: | - | Name of the registered component to load from bundle specified in `jsBundleSource` |
50+
| `jsBundleSource` | `string` | :ballot_box_with_check: | - | Name on file storage or URL to the JavaScript bundle to load |
51+
| `initialProperties` | `object` | :white_large_square: | `{}` | Initial props for the sandboxed app |
52+
| `launchOptions` | `object` | :white_large_square: | `{}` | Launch configuration options |
53+
| `allowedTurboModules` | `string[]` | :white_large_square: | [check here](./src/index.tsx#L18) | Additional TurboModules to allow |
54+
| `onMessage` | `function` | :white_large_square: | `undefined` | Callback for messages from sandbox |
55+
| `onError` | `function` | :white_large_square: | `undefined` | Callback for sandbox errors |
56+
| `style` | `ViewStyle` | :white_large_square: | `undefined` | Container styling |
5757

5858
### Ref Methods
5959

packages/react-native-sandbox/specs/NativeSandboxReactNativeView.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ export interface NativeProps extends ViewProps {
4444
*/
4545
moduleName: string
4646

47-
/** Optional path or URL to the JavaScript bundle source */
48-
jsBundleSource?: string
47+
/** Name on file storage or URL to the JavaScript bundle to load */
48+
jsBundleSource: string
4949

5050
/** Initial properties to pass to the sandboxed app's root component */
5151
initialProperties?: CodegenTypes.UnsafeMixed

packages/react-native-sandbox/src/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export type SandboxReactNativeViewProps = ViewProps & {
6767
* Optional path or URL to the JavaScript bundle to load.
6868
* If not provided, the default bundle will be used.
6969
*/
70-
jsBundleSource?: string
70+
jsBundleSource: string
7171

7272
/**
7373
* Initial properties to pass to the sandboxed React Native app.
@@ -203,7 +203,7 @@ const SandboxReactNativeView = forwardRef<
203203
const _onError = useCallback(
204204
(e: NativeSyntheticEvent<ErrorEvent>) => {
205205
// @ts-ignore
206-
onError?.(e.nativeEvent)
206+
onError?.(e.nativeEvent as ErrorEvent)
207207
},
208208
[onError]
209209
)

0 commit comments

Comments
 (0)