Good day. I'm new to composable architecture and Im currently trying to make a list of cards by using ForEachStore
because I want to pass the current state to the detail screen of the list and also trying to implement the pagination for the list with ForEachStore
var body: some View {
WithViewStore(self.store, observe: ViewState.init) { (viewStore: ViewStore<ViewState, PhotoListFeature.Action>) in
NavigationStack {
ScrollView {
LazyVStack {
ForEachStore( self.store.scope(
state: \.photoList,
action: PhotoListFeature.Action.photo(id:action:)
)) { _ in
Button {
} label: {
}.task {
}
}
}
}
.refreshable {
Task {
viewStore.send(.refreshPhotos)
}
}
.navigationDestination(
store: self.store.scope(
state: \.destination,
action: PhotoListFeature.Action.destination
),
state: /PhotoListFeature.Destination.State.showPhotoDetail,
action: PhotoListFeature.Destination.Action.showPhotoDetail
) { store in
PhotoDetailView(store: store)
}
.task {
viewStore.send(.fetchPhotos)
}
}
}
}
but unfortunately, I'm getting these errors: