Remove the extra AnyView wrap

This commit is contained in:
DreamPiggy 2020-03-29 21:27:11 +08:00
parent 59634bfab8
commit b084945b0f
1 changed files with 2 additions and 2 deletions

View File

@ -137,12 +137,12 @@ public struct WebImage : View {
/// Placeholder View Support
func setupPlaceholder() -> some View {
// Don't use `Group` because it will trigger `.onAppear` and `.onDisappear` when condition view removed, treat placeholder as an entire component
if placeholder != nil {
if let placeholder = placeholder {
// If use `.delayPlaceholder`, the placeholder is applied after loading failed, hide during loading :)
if imageManager.options.contains(.delayPlaceholder) && imageManager.isLoading {
return AnyView(configure(image: Image.empty))
} else {
return AnyView(placeholder)
return placeholder
}
} else {
return AnyView(configure(image: Image.empty))