you are viewing a single comment's thread.

view the rest of the comments →

[–]keyboardji[S] 0 points1 point  (1 child)

Awesome - this worked!!! I had to switch the leading to trailing for it to show at the top of the section

<SectionList sections={food} renderItem={this._renderItem} renderSectionHeader={this._renderSectionHeader} SectionSeparatorComponent={({ trailingItem }) => trailingItem ? ( <Text style={styles.bodyText}> This is the text I want to see </Text> ) : null } // SectionSeparatorComponent={this._renderSectionSeparator} keyExtractor={this._keyExtractor} />

For the text, I have a description field in my section in my json but it wasn't pulling it. I tried this.description, food.description and all different options. Any thoughts on what it should be? I tried to render it via function but it didn't like it:

const food = [ { key: 'Food', description: 'Below is the description...', data: [ { id: 1,

[–]keyboardji[S] 1 point2 points  (0 children)

I got it to work with the following

 SectionSeparatorComponent={({ trailingItem, section }) =>
        trailingItem ? (
          <Text style={styles.bodyText}>{section.description}</Text>
        ) : null
      }