The property is already a published entity in an observable object. Any changes to the name property will be propagated to the SwiftUI view. The issue was your nameBinding property. Unwrapping viewModel.name is you really had to do then passed the value into a Binding init constant as seen here ChildView(selectedName: .constant(name)).
struct ParentView: View {
@StateObject var viewModel = Model()
var body: some View {
VStack(alignment: .leading, spacing: 8) {
Text("Name is \(viewModel.name ?? "nil")")
Button("Make name nil") {
viewModel.makeNameNil()
}
if let name = viewModel.name {
ChildView(selectedName: .constant(name))
}
}
.padding()
}
}