Skip to content

Instantly share code, notes, and snippets.

@olegkalyta
Last active September 26, 2018 08:13
Show Gist options
  • Save olegkalyta/fac0e7311a22af565628056a57e017a2 to your computer and use it in GitHub Desktop.
Save olegkalyta/fac0e7311a22af565628056a57e017a2 to your computer and use it in GitHub Desktop.
const Filter = ({ categories, selectedCategories, toggleCategory }) => (
<View style={{ flex: 1 }}>
<FlatList
data={categories}
extraData={selectedCategories}
keyExtractor={i => i.id}
renderItem={({ item }) => (
<FilterItem
category={item}
isShown={!!selectedCategories.find(sc => sc.id === item.id)}
key={item.id}
onClick={toggleCategory}
/>
)}
/>
</View>
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment