Cannot convert value of type 'Binding<String>.Type' to expected argument type 'Binding<String>' error in swift 5 Xcode 12.3

I have error: Cannot convert value of type 'Binding<String>.Type' to expected argument type 'Binding<String>'

I am using Xcode version 12.3, swift 5 and iOS 14.3

Occurred when grouping static containers (TextField and Text)

struct ContentView_Previews: PreviewProvider {

    static var previews: some View {

        ContentView(text: Binding<String>) // error is here

    }

}

How can I solve this ?

How can I solve this ?

That depends on how you defined your ContentView.

You can try something like this:
Code Block
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView(text: .constant("test value")) // <-
}
}

When your ContentView have an @Binding property named text of type String, you need to pass an instance of Binding<String>, not the type name of itself.
Cannot convert value of type 'Binding&lt;String&gt;.Type' to expected argument type 'Binding&lt;String&gt;' error in swift 5 Xcode 12.3
 
 
Q