It appears you are using the version of ForEachStore that works with plain arrays and their indices, but we highly recommend using IdentifiedArray instead. Doing so prevents a large class of subtle bugs in which the list can re-order/change while an effect is inflight, causing the effect to send action to the wrong/a missing row. We will probably deprecate the array-based tools in TCA someday soon.
Once you convert over IdentifiedArray each row will have a unique identifier which can be used for the tag. You could even put that logic directly in the MeetingCard view:
struct MeetingCard: View {
...
var body: some View {
WithViewStore(self.store...) { viewStore in
VStack {
...
}
.tag(viewStore.id)
}
}
The indexChanged gets the correct index - in the ForEachStore example, I always receive 0 even though ViewStore(store).index returns the correct id.
This is because ViewStore(store).index refers to the currently selected index, not the index of the item in the collection.