ForEach<_StoreCollection<String, State, Action>, ObjectIdentifier, SingleTaskView>: the ID ObjectIdentifier(0x0000600003fe8b40) occurs multiple times within the collection, this will give undefined results! #3059
Replies: 2 comments
-
I logged |
Beta Was this translation helpful? Give feedback.
-
@zhangpeibj01 In the upgrade guide we note that the 1:1 migration requires you to explicitly select the So you should update your code for a true comparison: ForEach(
- store.scope(state: \.tasks, action: \.tasks)
+ store.scope(state: \.tasks, action: \.tasks), id: \.state.id
) { store in
SingleTaskView(store: store)
} I'm going to convert this to a discussion since it doesn't appear to be a bug with the library, but if you do think you've encountered a bug, please provide a sample project that reproduces the issue. Without it we won't be able to troubleshoot the problem. |
Beta Was this translation helpful? Give feedback.
-
Description
I have studied the latest code of ToDos and tried to improve my project. But the unexpected issue occured. I am not sure if I did something wrong.
I replace
Array<Task>
withIdentifiedArrayOf<Task>
and replacewith
Then the issue occured.
Checklist
main
branch of this package.Expected behavior
Can someone help me, Thanks
Actual behavior
ForEach<_StoreCollection<String, State, Action>, ObjectIdentifier, SingleTaskView>: the ID ObjectIdentifier(0x0000600003fe8b40) occurs multiple times within the collection, this will give undefined results!
Steps to reproduce
I tried to reassgin the value of state.todos.
The Composable Architecture version information
1.10.0
Destination operating system
macos 14.3
Xcode version information
Version 15.2 (15C500b)
Swift Compiler version information
Beta Was this translation helpful? Give feedback.
All reactions