I'm looking a way to make animated flatlist item after item. when one item finish his animation so next item(from the flatlist) will be on the screen
class AnimatedFlatList extends React.PureComponent {
state = {selected: (new Map(): Map<string, boolean>)};
let data = {[
{"first_name":"ltorrejon0@si.edu"},
{"first_name":"ichadbourne1@icq.com"},
{"first_name":"ascorthorne2@mediafire.com"},
{"first_name":"jlathwood3@xing.com"},
{"first_name":"molkowicz4@ftc.gov"},
{"first_name":"motridge5@tiny.cc"},
{"first_name":"rcess6@hostgator.com"},
{"first_name":"mmaundrell7@php.net"},
{"first_name":"ufairburne8@instagram.com"},
{"first_name":"pangel9@biglobe.ne.jp"}]
};
_keyExtractor = (item, index) => item.id;
_onPressItem = (id: string) => {
// updater functions are preferred for transactional updates
this.setState((state) => {
// copy the map rather than modifying state.
const selected = new Map(state.selected);
selected.set(id, !selected.get(id)); // toggle
return {selected};
});
};
_renderItem = (item) => (
<View style={Styles.viewItem}}>
<Text style={Styles.textItem>{item.text}</Text>
</View>
);
render() {
return (
<FlatList
data={data}
extraData={this.state}
keyExtractor={this._keyExtractor}
renderItem={this._renderItem}
/>
);
}
}
When I did animatedView
into the renderItem
it runs all together and it not what I'm looking for.
Kind of this way (but without press on the button, it will load automatically)