Why image detail view just show one image from listview?

I have list image and when I click the image list items it show me image details, but it show same image even I click the different image? any idea?

Datas:

 struct Datas: Identifiable {

  var id = UUID().uuidString
  var name: String
  var detail: String
  var image: String
}

var datas = [

  Datas(name: "People1.jpg"),
  Datas(name: "People.2jpg"),
  Datas(name: "People3.jpg"),
]

RowView:

struct RowView: View {
  var docs: Datas

  var body: some View {
 NavigationLink(destination:  ListDetailsView(docs: datas[0])) {

      Image(docs.image)
        .resizable()
        .frame(width: 64, height: 48)
        }
}

ListDetailsView:

struct ListDetailsView: View {

   var docs: Datas
   
  var body: some View {
     
    ZStack{
      Image(docs.image)
    }
     
  }
}

struct ListDetailsView_Previews: PreviewProvider {
  static var previews: some View {
    ListDetailsView(docs: datas[0])
  }
}
Answered by OOPer in 685901022

You have not shown any codes using RowView,

But I guess the problem lives here:

    NavigationLink(destination:  ListDetailsView(docs: datas[0])) {

It should be like this:

    NavigationLink(destination:  ListDetailsView(docs: docs)) {
Accepted Answer

You have not shown any codes using RowView,

But I guess the problem lives here:

    NavigationLink(destination:  ListDetailsView(docs: datas[0])) {

It should be like this:

    NavigationLink(destination:  ListDetailsView(docs: docs)) {
Why image detail view just show one image from listview?
 
 
Q