Skip to content

Filtering Sectionlist #22

@waltermvp

Description

@waltermvp

First off great lib, thank you.

Given that SectionList takes data that is structured by sections like so

<SectionList
  renderItem={({item, index, section}) => <Text key={index}>{item}</Text>}
  renderSectionHeader={({section: {title}}) => (
    <Text style={{fontWeight: 'bold'}}>{title}</Text>
  )}
  sections={[
    {title: 'Title1', data: ['item1', 'item2']},
    {title: 'Title2', data: ['item3', 'item4']},
    {title: 'Title3', data: ['item5', 'item6']},
  ]}
  keyExtractor={(item, index) => item + index}
/>

is there a way to filter the items using createFilter?
I have played around with
const KEYS_TO_FILTERS = ["data.exampleField", "data.example"];
and
const KEYS_TO_FILTERS = ["data.[0].exampleField", "data.[0].example"];

It may bot be possible, just want to make sure there is not a clever way to do it using KEYS_TO_FILTERS

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions