From b9d0615f37696443cc78abf30fe64d7aa5db144b Mon Sep 17 00:00:00 2001 From: Johannes Hilden Date: Wed, 9 Dec 2015 13:24:57 +0300 Subject: [PATCH] accept a renderOption prop on SegmentedControls --- lib/segmented-controls.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/segmented-controls.js b/lib/segmented-controls.js index e892df2..8f16d8a 100644 --- a/lib/segmented-controls.js +++ b/lib/segmented-controls.js @@ -88,7 +88,9 @@ class SegmentedControls extends React.Component { return ( 0 ? separatorStyle : baseOptionContainerStyle}> - {label} + {'function' === typeof this.props.renderOption ? this.props.renderOption.bind(this)(option, selected) : ( + {label} + )} );