about summary refs log tree commit diff
path: root/patches/react-native-view-shot+4.0.3.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/react-native-view-shot+4.0.3.patch')
-rw-r--r--patches/react-native-view-shot+4.0.3.patch28
1 files changed, 28 insertions, 0 deletions
diff --git a/patches/react-native-view-shot+4.0.3.patch b/patches/react-native-view-shot+4.0.3.patch
new file mode 100644
index 000000000..6c13a1f2a
--- /dev/null
+++ b/patches/react-native-view-shot+4.0.3.patch
@@ -0,0 +1,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) {