about summary refs log tree commit diff
diff options
context:
space:
mode:
authordan <dan.abramov@gmail.com>2024-04-04 22:54:18 +0100
committerGitHub <noreply@github.com>2024-04-04 22:54:18 +0100
commit575f390d7b4f295f9b163fb029cd2bd0088c83f9 (patch)
treeb49ee72bfc7d7859b64ef39054bdfe31c2038239
parent2e048706e9013fb808b5e302e3c540e34f1ea342 (diff)
downloadvoidsky-575f390d7b4f295f9b163fb029cd2bd0088c83f9.tar.zst
Fix false positive DEV check (#3410)
-rw-r--r--src/platform/polyfills.web.ts8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/platform/polyfills.web.ts b/src/platform/polyfills.web.ts
index 06fbe5cc4..462f65a26 100644
--- a/src/platform/polyfills.web.ts
+++ b/src/platform/polyfills.web.ts
@@ -19,6 +19,14 @@ if (process.env.NODE_ENV !== 'production') {
       typeof msgOrError === 'string' &&
       msgOrError.startsWith('Unexpected text node')
     ) {
+      if (
+        msgOrError ===
+        'Unexpected text node: . A text node cannot be a child of a <View>.'
+      ) {
+        // This is due to a stray empty string.
+        // React already handles this fine, so RNW warning is a false positive. Ignore.
+        return
+      }
       const err = new Error(msgOrError)
       thrownErrors.add(err)
       throw err