Why do you need a shared static property on AppModel?
This is obviously just a demo project to demonstrate the issue. In my real project, that property has to be accessible from other parts of the app
Since Folder conforms to identifiable in SidebarView could you just use ForEach(folders) { folder in?
Doesn't make a difference.
The crash output looks like this:
@ObservationIgnored private let _$observationRegistrar = Observation.ObservationRegistrar()
internal nonisolated func access<Member>(
keyPath: KeyPath<AppModel , Member>
) {
_$observationRegistrar.access(self, keyPath: keyPath)
}
internal nonisolated func withMutation<Member, MutationResult>(
keyPath: KeyPath<AppModel , Member>,
_ mutation: () throws -> MutationResult
) rethrows -> MutationResult {
try _$observationRegistrar.withMutation(of: self, keyPath: keyPath, mutation) --> Thread 1: Simultaneous accesses to 0x281bcc760, but modification requires exclusive access
}
@ObservationIgnored private var _selectedFolder: Folder? = nil