Fix false positive DEV check (#3410)

zio/stable
dan 2024-04-04 22:54:18 +01:00 committed by GitHub
parent 2e048706e9
commit 575f390d7b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 0 deletions

View File

@ -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