wix-incubator / react-native-custom-segmented-control

Custom version of the IOS SegmentedControl component
MIT License
168 stars 24 forks source link

Find index Pressed #9

Open Nexengineer opened 6 years ago

Nexengineer commented 6 years ago

Hi,

Really sorry to bother you, and thanks for building this component. Please can you share the code for finding the index Pressed on segmented slider. I am quite new to React Native.

oldtinroof commented 6 years ago

Hi @Nexengineer,

On your event handler, you can access the selected index with event.nativeEvent.selected

e.g.

handleTabSelect(event) {
    this.setState({ selectedTab: event.nativeEvent.selected });
  }