Skip to content

Commit 146d9c0

Browse files
committed
Removed the redundant id modifier.
1 parent 4072b9f commit 146d9c0

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

Sources/NavigationStack/NavigationStack.swift

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,6 @@ private struct ViewElement: Identifiable, Equatable {
149149
/// An alternative SwiftUI NavigationView implementing classic stack-based navigation giving also some more control on animations and programmatic navigation.
150150
public struct NavigationStackView<Root>: View where Root: View {
151151
@ObservedObject private var navViewModel: NavigationStack
152-
private let rootViewID = "root"
153152
private let rootView: Root
154153
private let transitions: (push: AnyTransition, pop: AnyTransition)
155154

@@ -188,12 +187,10 @@ public struct NavigationStackView<Root>: View where Root: View {
188187
Group {
189188
if showRoot {
190189
rootView
191-
.id(rootViewID)
192190
.transition(navigationType == .push ? transitions.push : transitions.pop)
193191
.environmentObject(navViewModel)
194192
} else {
195-
navViewModel.currentView!.wrappedElement
196-
.id(navViewModel.currentView!.id)
193+
navViewModel.currentView!.wrappedElement
197194
.transition(navigationType == .push ? transitions.push : transitions.pop)
198195
.environmentObject(navViewModel)
199196
}

0 commit comments

Comments
 (0)