-
Hello, I've been working with the Composable Architecture and encountered the "Perceptible state was accessed but is not being tracked" warning. Following the documentation, I wrapped my views in WithPerceptionTracking, which resolved the issue in most cases. However, I'm facing a persistent problem with NavigationStack initializer, particularly when using views in the destination case. Despite simple views like Text("test") being used, the warning still appears, suggesting a deeper structural issue. Any insights or solutions to this problem would be greatly appreciated. Below is the code I used, using Xcode 15 and targeting iOS 16.0 with 1.8.1 TCA library version. @Perception.Bindable var store: StoreOf<RootFeature>
var body: some View {
WithPerceptionTracking {
NavigationStack(
path: $store.scope(state: \.path, action: \.path)
) {
VStack {
switch store.stage {
case .splash:
SplashView(store: store)
case .login:
LoginView(store: store)
...
}
}
} destination: { store in
switch store.case {
case let .editAccountPassword(store):
Text("test")
// EditPasswordView(store: store)
}
}
}
} |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
You have to wrap the content of destination in another WithPerceptionTracking. |
Beta Was this translation helpful? Give feedback.
You have to wrap the content of destination in another WithPerceptionTracking.