Skip to content

Commit bf66cab

Browse files
fix(ios): use positional index for TabView tags to avoid duplicate .tag
1 parent aa34351 commit bf66cab

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

ios/PagerView.swift

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,9 @@ struct PagerView: View {
1010

1111
var body: some View {
1212
TabView(selection: $props.currentPage) {
13-
ForEach(props.children) { child in
14-
if let index = props.children.firstIndex(of: child) {
15-
RepresentableView(view: child.view)
16-
.tag(index)
17-
}
13+
ForEach(Array(props.children.enumerated()), id: \.element.id) { index, child in
14+
RepresentableView(view: child.view)
15+
.tag(index)
1816
}
1917
}
2018
.id(props.children.count)

0 commit comments

Comments
 (0)