Skip to content

Commit 8cae0ac

Browse files
author
Pavlo Aksonov
committed
set selected prop for selected tab
1 parent 77b80d4 commit 8cae0ac

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

Example/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
},
88
"dependencies": {
99
"react-native": "^0.20.0",
10-
"react-native-tabs": "^1.0.1"
10+
"react-native-tabs": "^1.0.2"
1111
}
1212
}

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class Tabs extends Component {
2828
style={[styles.iconView, this.props.iconStyle, el.props.name == this.props.selected ? this.props.selectedIconStyle || el.props.selectedIconStyle || {} : {} ]}
2929
onPress={()=>!self.props.locked && self.onSelect(el)}
3030
onLongPress={()=>self.props.locked && self.onSelect(el)}>
31-
{self.props.selected == el.props.name ? React.cloneElement(el, {style: {...el.props.style, ...this.props.selectedStyle, ...el.props.selectedStyle}}) : el}
31+
{self.props.selected == el.props.name ? React.cloneElement(el, {selected: true, style: {...el.props.style, ...this.props.selectedStyle, ...el.props.selectedStyle}}) : el}
3232
</TouchableOpacity>
3333
)}
3434
</View>

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-tabs",
3-
"version": "1.0.1",
3+
"version": "1.0.2",
44
"description": "React Native platform-independent tabs. Could be used for bottom tab bars as well as sectioned views (with tab buttons)",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)