1 possible answer(s) on “Insufficient docs for renderSectionHeader for

  1. OK, I figured it out, this is how it works:

      const getSectionHeaderId = (post) => {
        // passes a post from the array of posts, expects unique identifier
        return post.cat_id;
      };
      const renderSectionHeader = (cat_id) => {
        // passes unique identifier specified in getSectionHeaderId, expects rendered header
        const catTitle = _.filter(props.categories, {_id: cat_id})[0].title;
        return(
          <Divider styleName="section-header">
            <Caption>{catTitle}</Caption>
          </Divider>
        );
      };
      return (
        <ListView
          data={posts}
          loading={!postSubscription.ready()}
          renderRow={postRow}
          getSectionId={getSectionHeaderId}
          renderSectionHeader={renderSectionHeader}
        />
      );