about summary refs log tree commit diff
path: root/patches/react-native-view-shot+4.0.3.patch
blob: 6c13a1f2adade2b5a9d6ec5d0a4d72fc2f7a7dcb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
diff --git a/node_modules/react-native-view-shot/src/index.js b/node_modules/react-native-view-shot/src/index.js
index fa76d7e..018b686 100644
--- a/node_modules/react-native-view-shot/src/index.js
+++ b/node_modules/react-native-view-shot/src/index.js
@@ -125,13 +125,17 @@ export function captureRef<T: React$ElementType>(
     }
   }
   if (typeof view !== "number") {
-    const node = findNodeHandle(view);
-    if (!node) {
-      return Promise.reject(
-        new Error("findNodeHandle failed to resolve view=" + String(view))
-      );
+    if (Platform.OS == 'web') {
+      view = view;
+    } else {
+      const node = findNodeHandle(view);
+      if (!node) {
+        return Promise.reject(
+          new Error("findNodeHandle failed to resolve view=" + String(view))
+        );
+      }
+      view = node;
     }
-    view = node;
   }
   const { options, errors } = validateOptions(optionsObject);
   if (__DEV__ && errors.length > 0) {