why it throw an error as "'animation' was deprecated in iOS 15.0: Use withAnimation or animation(_:value:) instead"in SwiftUI 3.0?

I have a project, after update it to swiftUI 3.0, it is throw an error for   

.animation(.spring())

as animation' was deprecated in iOS 15.0: Use withAnimation or animation(_:value:) instead, any idea?

 @Binding var display: Bool

  private var background: some View {
  Color.black
   .fillParent()
   .opacity(0.6)
   .animation(.spring())
 }
Answered by skysoft13 in 705320022

I forget to add value after .spring(), it is work for me now.

 @Binding var display: Bool

  private var background: some View {
  Color.black
   .fillParent()
   .opacity(0.6)
   .animation(.spring(), value: display)
   
 }
Accepted Answer

I forget to add value after .spring(), it is work for me now.

 @Binding var display: Bool

  private var background: some View {
  Color.black
   .fillParent()
   .opacity(0.6)
   .animation(.spring(), value: display)
   
 }
why it throw an error as "'animation' was deprecated in iOS 15.0: Use withAnimation or animation(_:value:) instead"in SwiftUI 3.0?
 
 
Q