Skip to content

Commit c286b43

Browse files
committed
Patch rn-primitives to work on web
1 parent fee6bbe commit c286b43

3 files changed

Lines changed: 43 additions & 6 deletions

File tree

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
diff --git a/dist/index.js b/dist/index.js
2+
index 6f4a59cb5a895dbf5f79e162f303b7027140254b..05e87dcbd63b2a947e7993ba8583f0953da2e121 100644
3+
--- a/dist/index.js
4+
+++ b/dist/index.js
5+
@@ -48,6 +48,9 @@ var import_react_native = require("react-native");
6+
function useAccessibilityFocus(enabled = true) {
7+
const ref = React.useRef(null);
8+
React.useEffect(() => {
9+
+ if (import_react_native.Platform.OS === "web") {
10+
+ return;
11+
+ }
12+
if (!enabled) {
13+
return;
14+
}
15+
diff --git a/dist/index.mjs b/dist/index.mjs
16+
index 9d83a601b529ccb992145aad6d32f8215908037f..1e9fc44412a19c56c83309ecaff0569c6f872691 100644
17+
--- a/dist/index.mjs
18+
+++ b/dist/index.mjs
19+
@@ -2,10 +2,13 @@
20+
21+
// src/useAccessibilityFocus.tsx
22+
import * as React from "react";
23+
-import { AccessibilityInfo, findNodeHandle } from "react-native";
24+
+import { AccessibilityInfo, findNodeHandle, Platform as Platform0 } from "react-native";
25+
function useAccessibilityFocus(enabled = true) {
26+
const ref = React.useRef(null);
27+
React.useEffect(() => {
28+
+ if (Platform0.OS === "web") {
29+
+ return;
30+
+ }
31+
if (!enabled) {
32+
return;
33+
}

pnpm-lock.yaml

Lines changed: 8 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pnpm-workspace.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ packages:
1010
catalog:
1111
'@noble/curves': ^2.2.0
1212
'@noble/hashes': ^2.2.0
13-
typescript: ^5.9.3
1413
'@ubjs/core': 0.31.0-3
14+
typescript: ^5.9.3
1515
uniffi-bindgen-react-native: 0.31.0-3
1616

1717
linkWorkspacePackages: true
@@ -27,4 +27,5 @@ overrides:
2727

2828
patchedDependencies:
2929
'@expo/cli': patches/@expo__cli.patch
30+
'@rn-primitives/hooks@1.5.2': patches/@rn-primitives__hooks@1.5.2.patch
3031
uniffi-bindgen-react-native@0.31.0-3: patches/uniffi-bindgen-react-native@0.31.0-3.patch

0 commit comments

Comments
 (0)