title: Get index of SectionList Item React-Native
body: <p>I'm having problems getting the index of an header item from SectionList React-Native. By pressing the header, I am trying to get the index of the item and then passing this to a function. I have tried many things but had no luck. Any suggestions. Thanks</p>
  
  <p><a href="https://i.stack.imgur.com/VADKN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VADKN.png" alt="enter image description here"></a></p>
  
  <p>I want to press 3-30pm to return index 0
  i can press Lucian which returns me 0
  The idea is by getting me the header index, i can use with an array to delete an item from the list.</p>
  
  <pre><code>            &lt;SectionList style = {styles.itemSquare}
  
          renderItem = {({item, index, section}) =&gt;
              &lt; Text style={styles.SectionListItemStyle} key = {index}
              onPress={this.GetSectionListItem.bind(this, this.state.slotkeys[index])}&gt; {item}
              &lt; /Text&gt;}
  
              renderSectionHeader = {({section: {title}, index}) =&gt; (
                    &lt;TouchableHighlight &gt;
                      &lt;View&gt;
                        &lt;Text style={styles.SectionHeaderStyle}
                        onPress={this.GetSectionListItem.bind(this, index)}
                        &gt; {title}
                        &lt;Text style={styles.SectionHeaderCancel} &gt; {index} &lt; /Text&gt;
                        &lt;/Text&gt;
                      &lt;/View&gt;
                    &lt;/TouchableHighlight&gt;
                  )
              }
  
            sections = {this.state.slots.map(({ time, chosen_user, name, chosen_syllabud, user_id }) =&gt;
            ({ title: time, data: [[chosen_user], [chosen_syllabud], [user_id]], index:1 }))}
  
            keyExtractor = {(item, index) =&gt; item + index}
            /&gt;
  </code></pre>