SwiftUI error build: Extra argument in call

Let’s say your view is like this:

struct HomeView: View {
    let user: User
    let isAdmin: Bool = false
    
    var body: some View {

Code while calling the view:

HomeView(user: user, isAdmin: isAdmin)

If you build your SwiftUI project with the above code wit will give you this error: Extra argument ‘…’ in call. The solution is to replace the let with var in the property for which the error is coming, i.e replace the following line:

let isAdmin: Bool = false

with this:

var isAdmin: Bool = false

The complete will look like this:

struct HomeView: View {
    let user: User
    var isAdmin: Bool = false
    
    var body: some View {