temporary react-native-view-shot patch (#8383)

* temp patch

* fix
This commit is contained in:
hailey
2025-05-17 12:19:37 -07:00
committed by Hailey
parent 90e22f86ab
commit 289efece86
2 changed files with 31 additions and 0 deletions
+3
View File
@@ -0,0 +1,3 @@
## react-native-view-shot patch
Temporary patch for web, where `view`'s type has changed.
@@ -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) {