Skip to content

Commit

Permalink
chore: polyfill useSyncExternalStore (gronxb#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
gronxb authored Jan 31, 2024
1 parent cb846f8 commit 2e51e6d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
4 changes: 4 additions & 0 deletions packages/react-native/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,16 @@
},
"devDependencies": {
"@types/react": "^18.2.25",
"@types/use-sync-external-store": "^0.0.6",
"react": "^18.2.0",
"react-native-webview": "^13.6.2",
"typescript": "^5.2.2"
},
"peerDependencies": {
"react": "*",
"react-native-webview": "*"
},
"dependencies": {
"use-sync-external-store": "^1.2.0"
}
}
2 changes: 1 addition & 1 deletion packages/react-native/src/useBridge.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Bridge, BridgeStore, ExtractStore } from "@webview-bridge/types";
import { useSyncExternalStore } from "react";
import { useSyncExternalStore } from "use-sync-external-store/shim";

export function useBridge<T extends Bridge>(
store: BridgeStore<T>,
Expand Down
11 changes: 11 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2e51e6d

Please sign in to comment.