Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filtering Sectionlist #22

Open
waltermvp opened this issue Jul 31, 2018 · 1 comment
Open

Filtering Sectionlist #22

waltermvp opened this issue Jul 31, 2018 · 1 comment

Comments

@waltermvp
Copy link

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

@rmlevangelio
Copy link

Plus one with this question.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants