Skip to content

halilozel1903/FlatListApp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 

Repository files navigation

Flat List 📄 📜

FlatList

A performant interface for rendering basic, flat lists, supporting the most handy features:

  • Fully cross-platform.
  • Optional horizontal mode.
  • Configurable viewability callbacks.
  • Header support.
  • Footer support.
  • Separator support.
  • Pull to Refresh.
  • Scroll loading.
  • ScrollToIndex support.
  • Multiple column support.

Axios

Axios

Promise based HTTP client for the browser and node.js

For more details : https://github.com/axios/axios

  getContacts = async () => {
    const { data: { results: contacts }} = await axios.get('https://randomuser.me/api/?results=15');

    this.setState({
      contacts
    });

  };

FlatList use :

   render() {
    return (
       <FlatList
       ListHeaderComponent={this.renderHeader()}
       renderItem={this.renderContactsItem}
       keyExtractor={item => item.login.uuid}
       data={this.state.contacts}/>
     
    );
  }