From 575f390d7b4f295f9b163fb029cd2bd0088c83f9 Mon Sep 17 00:00:00 2001 From: dan Date: Thu, 4 Apr 2024 22:54:18 +0100 Subject: [PATCH] Fix false positive DEV check (#3410) --- src/platform/polyfills.web.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/platform/polyfills.web.ts b/src/platform/polyfills.web.ts index 06fbe5cc..462f65a2 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 .' + ) { + // 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