Skip to content

Commit 40e8115

Browse files
committed
Merge pull request ptomasroos#89 from mangogogos/master
Add a unique key to tab page mapping (for Android). fixes ptomasroos#86
2 parents b6c9f98 + 3eb27bd commit 40e8115

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

index.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,12 @@ var ScrollableTabView = React.createClass({
9999
this._updateScrollValue(position + offset);
100100
}}
101101
ref={(scrollView) => { this.scrollView = scrollView }}>
102-
{this.props.children.map((child) => {
103-
return <View style={{width: deviceWidth}}>{child}</View>
102+
{this.props.children.map((child,idx) => {
103+
return <View
104+
key={child.props.tabLabel + '_' + idx}
105+
style={{width: deviceWidth}}>
106+
{child}
107+
</View>
104108
})}
105109
</ViewPagerAndroid>
106110
);

0 commit comments

Comments
 (0)