File tree Expand file tree Collapse file tree 6 files changed +11211
-12
lines changed
Expand file tree Collapse file tree 6 files changed +11211
-12
lines changed Original file line number Diff line number Diff line change 1+ .nvmrc
12Example
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ class ExampleMain extends Component {
1111 super ( props ) ;
1212 this . state = {
1313 selectedIndex : 0 ,
14+ badgesStyleIndex : 0 ,
1415 customStyleIndex : 0 ,
1516 }
1617 }
@@ -22,6 +23,13 @@ class ExampleMain extends Component {
2223 } ) ;
2324 }
2425
26+ handleBadgesSelect = ( index ) => {
27+ this . setState ( {
28+ ...this . state ,
29+ badgesStyleIndex : index ,
30+ } ) ;
31+ }
32+
2533 handleCustomIndexSelect = ( index ) => {
2634 this . setState ( {
2735 ...this . state ,
@@ -43,8 +51,8 @@ class ExampleMain extends Component {
4351 < Text style = { styles . headerText } > Default segmented with badges</ Text >
4452 < SegmentedControlTab
4553 badges = { [ 1 , 2 , 3 ] }
46- selectedIndex = { this . state . selectedIndex }
47- onTabPress = { this . handleSingleIndexSelect } />
54+ selectedIndex = { this . state . badgesStyleIndex }
55+ onTabPress = { this . handleBadgesSelect } />
4856 < View style = { styles . Seperator } />
4957
5058 < Text style = { styles . headerText } > Custom segmented control with custom styles</ Text >
You can’t perform that action at this time.
0 commit comments