Crash when working with navigation api and NavigationSplitView #2915
Unanswered
marcuswu0814
asked this question in
Q&A
Replies: 1 comment 1 reply
-
I try to add a workaround for the crash. I replace the @ViewBuilder
func navigationLink(
_ title: String,
value: Feature.State.Tab
) -> some View {
Button(title) {
store.send(.switchTab(value))
}
.tag(value)
} and mutating the selection state via action, the crash just gone, but still want to know how to fix the issue and way to work |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi @mbrandonw, this is my reproduce project that crash when building my features with
NavigationSplitView
and TCA navigation api (maybe cause by NavigationPath).The project:
NavigationSplitView(sideBar:detail:)
two columns modeNavigationStack(path:)
api, and using the pattern likeReducer(state: .equatable) enum Path {}
Text("...")
Problems:
SwiftUI/NavigationColumnState.swift:560: Fatal error: 'try!' expression unexpectedly raised an error: SwiftUI.AnyNavigationPath.Error.comparisonTypeMismatch
I'm not sure it was a best practice to use
NavigationSplitView
with TCA like my project, if a better solution exist, please give some advice for me. 🙏Beta Was this translation helpful? Give feedback.
All reactions