fix(teleport): do not throw target warning when teleport is disabled (#9818)

This commit is contained in:
Yi Yang 2024-05-30 10:51:30 +08:00 committed by GitHub
parent cdb1d1795d
commit 15ee43f66a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 8 deletions

View File

@ -47,8 +47,7 @@ const resolveTarget = <T = RendererElement>(
return null
} else {
const target = select(targetSelector)
if (!target) {
__DEV__ &&
if (__DEV__ && !target && !isTeleportDisabled(props)) {
warn(
`Failed to locate Teleport target with selector "${targetSelector}". ` +
`Note the target element must exist before the component is mounted - ` +