Skip to content

Commit

Permalink
Merge pull request #8 from johanneshilden/master
Browse files Browse the repository at this point in the history
Add a renderOption prop on SegmentedControls
  • Loading branch information
ArnaudRinquin committed Dec 21, 2015
2 parents 34121a3 + b9d0615 commit f830a00
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/segmented-controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@ class SegmentedControls extends React.Component {
return (
<TouchableWithoutFeedback onPress={onSelect} key={index}>
<View style={index > 0 ? separatorStyle : baseOptionContainerStyle}>
<Text style={style}>{label}</Text>
{'function' === typeof this.props.renderOption ? this.props.renderOption.bind(this)(option, selected) : (
<Text style={style}>{label}</Text>
)}
</View>
</TouchableWithoutFeedback>
);
Expand Down

0 comments on commit f830a00

Please sign in to comment.