@webview-bridge/react-native 1.1.2 → 1.3.0-nightly.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/packages/react-native/src/createWebView.d.ts +2 -2
- package/dist/packages/react-native/src/createWebView.js +24 -3
- package/dist/packages/react-native/src/index.d.ts +2 -1
- package/dist/packages/react-native/src/index.js +2 -1
- package/dist/packages/react-native/src/integrations/bridge.d.ts +9 -4
- package/dist/packages/react-native/src/integrations/bridge.js +48 -5
- package/dist/packages/react-native/src/integrations/console.d.ts +1 -1
- package/dist/packages/react-native/src/integrations/console.js +2 -2
- package/dist/packages/react-native/src/integrations/handleRegisterWebMethod.d.ts +1 -1
- package/dist/packages/react-native/src/integrations/handleRegisterWebMethod.js +5 -5
- package/dist/packages/react-native/src/useBridge.d.ts +3 -0
- package/dist/packages/react-native/src/useBridge.js +9 -0
- package/dist/shared/util/src/createEvents.d.ts +1 -1
- package/dist/shared/util/src/createEvents.js +2 -2
- package/dist/shared/util/src/equals.d.ts +1 -0
- package/dist/shared/util/src/equals.js +50 -0
- package/dist/shared/util/src/index.d.ts +2 -0
- package/dist/shared/util/src/index.js +2 -0
- package/dist/shared/util/src/removeUndefinedKeys.d.ts +1 -0
- package/dist/shared/util/src/removeUndefinedKeys.js +13 -0
- package/dist/shared/util/src/types.d.ts +23 -0
- package/package.json +5 -1
- package/dist/packages/react-native/src/types/bridge.d.ts +0 -2
- /package/dist/{packages/react-native/src/types/bridge.js → shared/util/src/types.js} +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import type { Bridge, BridgeStore } from "../../../shared/util/src/types";
|
|
1
2
|
import React from "react";
|
|
2
|
-
import { Bridge } from "./types/bridge";
|
|
3
3
|
import type { BridgeWebView } from "./types/webview";
|
|
4
4
|
export type CreateWebViewArgs<BridgeObject extends Bridge> = {
|
|
5
|
-
bridge: BridgeObject
|
|
5
|
+
bridge: BridgeStore<BridgeObject>;
|
|
6
6
|
debug?: boolean;
|
|
7
7
|
responseTimeout?: number;
|
|
8
8
|
fallback?: (method: keyof BridgeObject) => void;
|
|
@@ -16,14 +16,28 @@ const createWebView = ({ bridge, debug, responseTimeout = 2000, fallback, }) =>
|
|
|
16
16
|
isReady: false,
|
|
17
17
|
},
|
|
18
18
|
};
|
|
19
|
+
const _webviewRef = (0, react_1.createRef)();
|
|
19
20
|
const emitter = (0, util_1.createEvents)();
|
|
21
|
+
bridge.subscribe((state) => {
|
|
22
|
+
_webviewRef.current?.injectJavaScript(`
|
|
23
|
+
window.nativeEmitter.emit('bridgeStateChange', ${JSON.stringify(state)});
|
|
24
|
+
`);
|
|
25
|
+
});
|
|
20
26
|
return {
|
|
21
27
|
WebView: (0, react_1.forwardRef)((props, ref) => {
|
|
22
28
|
const webviewRef = (0, react_1.useRef)(null);
|
|
23
|
-
const bridgeNames = (0, react_1.useMemo)(() => Object.values(bridge ?? {})
|
|
29
|
+
const bridgeNames = (0, react_1.useMemo)(() => Object.values(bridge.getState() ?? {})
|
|
30
|
+
.filter((bridge) => typeof bridge === "function")
|
|
31
|
+
.map((func) => {
|
|
24
32
|
return `'${func.name}'`;
|
|
25
33
|
}), []);
|
|
34
|
+
const initialState = (0, react_1.useMemo)(() => Object.fromEntries(Object.entries(bridge.getState() ?? {})
|
|
35
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
36
|
+
.filter(([_, value]) => typeof value !== "function")), []);
|
|
26
37
|
(0, react_1.useImperativeHandle)(ref, () => webviewRef.current, []);
|
|
38
|
+
(0, react_1.useImperativeHandle)(_webviewRef, () => {
|
|
39
|
+
return webviewRef.current;
|
|
40
|
+
}, []);
|
|
27
41
|
const handleMessage = async (event) => {
|
|
28
42
|
props.onMessage?.(event);
|
|
29
43
|
if (!webviewRef.current) {
|
|
@@ -47,6 +61,12 @@ const createWebView = ({ bridge, debug, responseTimeout = 2000, fallback, }) =>
|
|
|
47
61
|
});
|
|
48
62
|
return;
|
|
49
63
|
}
|
|
64
|
+
case "getBridgeState": {
|
|
65
|
+
_webviewRef.current?.injectJavaScript(`
|
|
66
|
+
window.nativeEmitter.emit('bridgeStateChange', ${JSON.stringify(bridge.getState())});
|
|
67
|
+
`);
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
50
70
|
case "registerWebMethod": {
|
|
51
71
|
const { bridgeNames } = body;
|
|
52
72
|
Object.assign(WebMethod.current, (0, handleRegisterWebMethod_1.handleRegisterWebMethod)(emitter, webviewRef.current, bridgeNames, responseTimeout));
|
|
@@ -71,13 +91,14 @@ const createWebView = ({ bridge, debug, responseTimeout = 2000, fallback, }) =>
|
|
|
71
91
|
}
|
|
72
92
|
};
|
|
73
93
|
return (<react_native_webview_1.default {...props} ref={webviewRef} onMessage={handleMessage} injectedJavaScriptBeforeContentLoaded={[
|
|
74
|
-
(0, integrations_1.
|
|
94
|
+
(0, integrations_1.INJECT_BRIDGE_METHODS)(bridgeNames),
|
|
95
|
+
(0, integrations_1.INJECT_BRIDGE_STATE)(initialState),
|
|
75
96
|
props.injectedJavaScriptBeforeContentLoaded,
|
|
76
97
|
"true;",
|
|
77
98
|
]
|
|
78
99
|
.filter(Boolean)
|
|
79
100
|
.join("\n")} injectedJavaScript={[
|
|
80
|
-
console && integrations_1.
|
|
101
|
+
console && integrations_1.INJECT_DEBUG,
|
|
81
102
|
props.injectedJavaScript,
|
|
82
103
|
"true;",
|
|
83
104
|
]
|
|
@@ -16,5 +16,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./createWebView"), exports);
|
|
18
18
|
__exportStar(require("./integrations/bridge"), exports);
|
|
19
|
-
__exportStar(require("./types/bridge"), exports);
|
|
20
19
|
__exportStar(require("./types/webview"), exports);
|
|
20
|
+
__exportStar(require("./useBridge"), exports);
|
|
21
|
+
__exportStar(require("../../../shared/util/src/types"), exports);
|
|
@@ -1,13 +1,18 @@
|
|
|
1
|
+
import type { Bridge, BridgeStore, OnlyJSON, Primitive } from "../../../../shared/util/src/types";
|
|
1
2
|
import WebView from "react-native-webview";
|
|
2
|
-
|
|
3
|
-
|
|
3
|
+
export type StoreCallback<T> = ({ get, set, }: {
|
|
4
|
+
get: () => T;
|
|
5
|
+
set: (newState: Partial<OnlyJSON<T>>) => void;
|
|
6
|
+
}) => T;
|
|
7
|
+
export declare const bridge: <T extends Bridge>(procedures: T | StoreCallback<T>) => BridgeStore<T>;
|
|
4
8
|
type HandleBridgeArgs<ArgType = unknown> = {
|
|
5
|
-
bridge: Bridge
|
|
9
|
+
bridge: BridgeStore<Bridge>;
|
|
6
10
|
method: string;
|
|
7
11
|
args?: ArgType[];
|
|
8
12
|
webview: WebView;
|
|
9
13
|
eventId: string;
|
|
10
14
|
};
|
|
11
15
|
export declare const handleBridge: ({ bridge, method, args, webview, eventId, }: HandleBridgeArgs) => Promise<void>;
|
|
12
|
-
export declare const
|
|
16
|
+
export declare const INJECT_BRIDGE_METHODS: (bridgeNames: string[]) => string;
|
|
17
|
+
export declare const INJECT_BRIDGE_STATE: (initialState: Record<string, Primitive>) => string;
|
|
13
18
|
export {};
|
|
@@ -1,13 +1,52 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.INJECT_BRIDGE_STATE = exports.INJECT_BRIDGE_METHODS = exports.handleBridge = exports.bridge = void 0;
|
|
4
|
+
const util_1 = require("../../../../shared/util/src");
|
|
4
5
|
const bridge = (procedures) => {
|
|
5
|
-
|
|
6
|
+
const getState = () => state;
|
|
7
|
+
const setState = (newState) => {
|
|
8
|
+
const _newState = {
|
|
9
|
+
...state,
|
|
10
|
+
...(0, util_1.removeUndefinedKeys)(newState),
|
|
11
|
+
};
|
|
12
|
+
if ((0, util_1.equals)(state, _newState)) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
const prevState = state;
|
|
16
|
+
state = _newState;
|
|
17
|
+
emitChange(state, prevState);
|
|
18
|
+
};
|
|
19
|
+
let state = typeof procedures === "function"
|
|
20
|
+
? procedures({
|
|
21
|
+
get: getState,
|
|
22
|
+
set: setState,
|
|
23
|
+
})
|
|
24
|
+
: procedures;
|
|
25
|
+
const listeners = new Set();
|
|
26
|
+
const emitChange = (newState, prevState) => {
|
|
27
|
+
for (const listener of listeners) {
|
|
28
|
+
listener(newState, prevState);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
const subscribe = (listener) => {
|
|
32
|
+
listeners.add(listener);
|
|
33
|
+
return () => listeners.delete(listener);
|
|
34
|
+
};
|
|
35
|
+
return {
|
|
36
|
+
getState,
|
|
37
|
+
setState,
|
|
38
|
+
subscribe,
|
|
39
|
+
};
|
|
6
40
|
};
|
|
7
41
|
exports.bridge = bridge;
|
|
8
42
|
const handleBridge = async ({ bridge, method, args, webview, eventId, }) => {
|
|
43
|
+
const _bridge = bridge.getState();
|
|
44
|
+
const _method = _bridge[method];
|
|
45
|
+
if (typeof _method !== "function") {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
9
48
|
try {
|
|
10
|
-
const response = await
|
|
49
|
+
const response = await _method?.(...(args ?? []));
|
|
11
50
|
webview.injectJavaScript(`
|
|
12
51
|
window.nativeEmitter.emit('${method}-${eventId}',${JSON.stringify(response)});
|
|
13
52
|
|
|
@@ -24,7 +63,11 @@ const handleBridge = async ({ bridge, method, args, webview, eventId, }) => {
|
|
|
24
63
|
}
|
|
25
64
|
};
|
|
26
65
|
exports.handleBridge = handleBridge;
|
|
27
|
-
const
|
|
66
|
+
const INJECT_BRIDGE_METHODS = (bridgeNames) => `
|
|
28
67
|
window.__bridgeMethods__ = [${bridgeNames.join(", ")}];
|
|
29
68
|
`;
|
|
30
|
-
exports.
|
|
69
|
+
exports.INJECT_BRIDGE_METHODS = INJECT_BRIDGE_METHODS;
|
|
70
|
+
const INJECT_BRIDGE_STATE = (initialState) => `
|
|
71
|
+
window.__bridgeInitialState__ = ${JSON.stringify(initialState)};
|
|
72
|
+
`;
|
|
73
|
+
exports.INJECT_BRIDGE_STATE = INJECT_BRIDGE_STATE;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const
|
|
1
|
+
export declare const INJECT_DEBUG = "\n{\n const originalConsoleLog = console.log;\n const originalConsoleError = console.error;\n const originalConsoleWarn = console.warn;\n\n console.log = function() {\n var message = Array.from(arguments).join(' ');\n window.ReactNativeWebView?.postMessage(\n JSON.stringify({ type: \"log\", body: { method: \"log\", args: message } }),\n );\n originalConsoleLog.apply(console, arguments);\n };\n\n console.error = function() {\n var message = Array.from(arguments).join(' ');\n window.ReactNativeWebView?.postMessage(\n JSON.stringify({ type: \"log\", body: { method: \"error\", args: message } }),\n );\n originalConsoleError.apply(console, arguments);\n };\n\n console.warn = function() {\n var message = Array.from(arguments).join(' ');\n window.ReactNativeWebView?.postMessage(\n JSON.stringify({ type: \"log\", body: { method: \"warn\", args: message } }),\n );\n originalConsoleWarn.apply(console, arguments);\n };\n};\n";
|
|
2
2
|
export type LogType = "log" | "error" | "warn";
|
|
3
3
|
export declare const handleLog: (type: LogType, message?: unknown) => void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.handleLog = exports.
|
|
4
|
-
exports.
|
|
3
|
+
exports.handleLog = exports.INJECT_DEBUG = void 0;
|
|
4
|
+
exports.INJECT_DEBUG = `
|
|
5
5
|
{
|
|
6
6
|
const originalConsoleLog = console.log;
|
|
7
7
|
const originalConsoleError = console.error;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
+
import { Bridge } from "../../../../shared/util/src/types";
|
|
1
2
|
import { type EventEmitter } from "../../../../shared/util/src";
|
|
2
3
|
import WebView from "react-native-webview";
|
|
3
|
-
import { Bridge } from "../types/bridge";
|
|
4
4
|
export declare const handleRegisterWebMethod: (emitter: EventEmitter, webview: WebView, bridgeNames: string[], responseTimeout: number) => Bridge;
|
|
@@ -4,17 +4,17 @@ exports.handleRegisterWebMethod = void 0;
|
|
|
4
4
|
const util_1 = require("../../../../shared/util/src");
|
|
5
5
|
const error_1 = require("../error");
|
|
6
6
|
const handleRegisterWebMethod = (emitter, webview, bridgeNames, responseTimeout) => {
|
|
7
|
-
return bridgeNames.reduce((acc,
|
|
8
|
-
acc[
|
|
7
|
+
return bridgeNames.reduce((acc, methodName) => {
|
|
8
|
+
acc[methodName] = async (...args) => {
|
|
9
9
|
const eventId = (0, util_1.createRandomId)();
|
|
10
10
|
return Promise.race([
|
|
11
|
-
(0, util_1.createResolver)(emitter,
|
|
11
|
+
(0, util_1.createResolver)(emitter, methodName, eventId, () => {
|
|
12
12
|
webview.injectJavaScript(`
|
|
13
|
-
window.webEmitter.emit('${
|
|
13
|
+
window.webEmitter.emit('${methodName}', '${eventId}', ${JSON.stringify(args)});
|
|
14
14
|
|
|
15
15
|
true;
|
|
16
16
|
`);
|
|
17
|
-
}, new error_1.WebMethodError(
|
|
17
|
+
}, new error_1.WebMethodError(methodName)),
|
|
18
18
|
(0, util_1.timeout)(responseTimeout),
|
|
19
19
|
]);
|
|
20
20
|
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { Bridge, BridgeStore, ExtractStore } from "../../../shared/util/src/types";
|
|
2
|
+
export declare function useBridge<T extends Bridge>(store: BridgeStore<T>): ExtractStore<BridgeStore<T>>;
|
|
3
|
+
export declare function useBridge<T extends Bridge, U extends ExtractStore<BridgeStore<T>>, V>(store: BridgeStore<T>, selector?: (state: U) => V): V;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useBridge = void 0;
|
|
4
|
+
const shim_1 = require("use-sync-external-store/shim");
|
|
5
|
+
function useBridge(store, selector) {
|
|
6
|
+
const getSnapshot = () => selector?.(store.getState()) ?? store.getState();
|
|
7
|
+
return (0, shim_1.useSyncExternalStore)(store.subscribe, getSnapshot);
|
|
8
|
+
}
|
|
9
|
+
exports.useBridge = useBridge;
|
|
@@ -12,5 +12,5 @@ export interface EventEmitter<Events extends EventsMap = DefaultEvents> {
|
|
|
12
12
|
on<K extends keyof Events>(this: this, event: K, cb: Events[K]): () => void;
|
|
13
13
|
}
|
|
14
14
|
export declare const createEvents: <Events extends EventsMap = DefaultEvents>() => EventEmitter<Events>;
|
|
15
|
-
export declare const createResolver: (emitter: EventEmitter<DefaultEvents>,
|
|
15
|
+
export declare const createResolver: (emitter: EventEmitter<DefaultEvents>, methodName: string, eventId: string, evaluate: () => void, failHandler?: Error | false) => Promise<unknown>;
|
|
16
16
|
export {};
|
|
@@ -17,9 +17,9 @@ const createEvents = () => ({
|
|
|
17
17
|
},
|
|
18
18
|
});
|
|
19
19
|
exports.createEvents = createEvents;
|
|
20
|
-
const createResolver = (emitter,
|
|
20
|
+
const createResolver = (emitter, methodName, eventId, evaluate, failHandler = false) => {
|
|
21
21
|
return new Promise((resolve, reject) => {
|
|
22
|
-
const unbind = emitter.on(`${
|
|
22
|
+
const unbind = emitter.on(`${methodName}-${eventId}`, (data, throwOccurred) => {
|
|
23
23
|
unbind();
|
|
24
24
|
if (throwOccurred) {
|
|
25
25
|
if (failHandler instanceof Error) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const equals: (a: any, b: any) => boolean;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.equals = void 0;
|
|
4
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5
|
+
const equals = (a, b) => {
|
|
6
|
+
if (a === b) {
|
|
7
|
+
return true;
|
|
8
|
+
}
|
|
9
|
+
if (a && b && typeof a === "object" && typeof b === "object") {
|
|
10
|
+
const arrA = Array.isArray(a);
|
|
11
|
+
const arrB = Array.isArray(b);
|
|
12
|
+
let i;
|
|
13
|
+
let length;
|
|
14
|
+
let key;
|
|
15
|
+
if (arrA && arrB) {
|
|
16
|
+
length = a.length;
|
|
17
|
+
if (length !== b.length) {
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
for (i = length; i-- !== 0;) {
|
|
21
|
+
if (!(0, exports.equals)(a[i], b[i])) {
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return true;
|
|
26
|
+
}
|
|
27
|
+
if (arrA !== arrB) {
|
|
28
|
+
return false;
|
|
29
|
+
}
|
|
30
|
+
const keys = Object.keys(a);
|
|
31
|
+
length = keys.length;
|
|
32
|
+
if (length !== Object.keys(b).length) {
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
35
|
+
for (i = length; i-- !== 0;) {
|
|
36
|
+
if (!Object.prototype.hasOwnProperty.call(b, keys[i])) {
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
for (i = length; i-- !== 0;) {
|
|
41
|
+
key = keys[i];
|
|
42
|
+
if (!(0, exports.equals)(a[key], b[key])) {
|
|
43
|
+
return false;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return true;
|
|
47
|
+
}
|
|
48
|
+
return a !== a && b !== b;
|
|
49
|
+
};
|
|
50
|
+
exports.equals = equals;
|
|
@@ -16,5 +16,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./createEvents"), exports);
|
|
18
18
|
__exportStar(require("./createRandomId"), exports);
|
|
19
|
+
__exportStar(require("./equals"), exports);
|
|
19
20
|
__exportStar(require("./noop"), exports);
|
|
21
|
+
__exportStar(require("./removeUndefinedKeys"), exports);
|
|
20
22
|
__exportStar(require("./timeout"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const removeUndefinedKeys: (obj: Record<string, any>) => Record<string, any>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.removeUndefinedKeys = void 0;
|
|
4
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5
|
+
const removeUndefinedKeys = (obj) => {
|
|
6
|
+
Object.keys(obj).forEach((key) => {
|
|
7
|
+
if (obj[key] === undefined) {
|
|
8
|
+
delete obj[key];
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
return obj;
|
|
12
|
+
};
|
|
13
|
+
exports.removeUndefinedKeys = removeUndefinedKeys;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export type AsyncFunction = (...args: any[]) => Promise<any>;
|
|
2
|
+
export type Primitive = string | number | boolean | null | undefined;
|
|
3
|
+
export type RawJSON = Primitive | {
|
|
4
|
+
[key: string]: RawJSON;
|
|
5
|
+
} | RawJSONArray;
|
|
6
|
+
interface RawJSONArray extends Array<RawJSON> {
|
|
7
|
+
}
|
|
8
|
+
export type Bridge = Record<string, AsyncFunction | RawJSON>;
|
|
9
|
+
export type BridgeStore<T extends Bridge> = {
|
|
10
|
+
getState: () => T;
|
|
11
|
+
setState: (newState: Partial<OnlyJSON<T>>) => void;
|
|
12
|
+
subscribe: (listener: (newState: T, prevState: T) => void) => () => void;
|
|
13
|
+
};
|
|
14
|
+
export type ExtractStore<S> = S extends {
|
|
15
|
+
getState: () => infer T;
|
|
16
|
+
} ? T : never;
|
|
17
|
+
export type OnlyJSON<T> = {
|
|
18
|
+
[P in keyof T as T[P] extends RawJSON ? P : never]: T[P];
|
|
19
|
+
};
|
|
20
|
+
export type ExcludePrimitive<T> = {
|
|
21
|
+
[P in keyof T as T[P] extends RawJSON ? never : P]: T[P];
|
|
22
|
+
};
|
|
23
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webview-bridge/react-native",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0-nightly.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Fully Type-Safe Integration for React Native WebView and Web",
|
|
6
6
|
"main": "dist/packages/react-native/src/index.js",
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
],
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"@types/react": "^18.2.25",
|
|
22
|
+
"@types/use-sync-external-store": "^0.0.6",
|
|
22
23
|
"react": "^18.2.0",
|
|
23
24
|
"react-native-webview": "^13.6.2",
|
|
24
25
|
"typescript": "^5.2.2"
|
|
@@ -27,6 +28,9 @@
|
|
|
27
28
|
"react": "*",
|
|
28
29
|
"react-native-webview": "*"
|
|
29
30
|
},
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"use-sync-external-store": "^1.2.0"
|
|
33
|
+
},
|
|
30
34
|
"scripts": {
|
|
31
35
|
"build": "tspc",
|
|
32
36
|
"test:type": "tsc --noEmit"
|
|
File without changes
|