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

Check the render method of 'Flatlistdemo' #25741

Closed
keshav00001 opened this issue Jul 19, 2019 · 4 comments
Closed

Check the render method of 'Flatlistdemo' #25741

keshav00001 opened this issue Jul 19, 2019 · 4 comments
Labels
Bug Component: FlatList Ran Commands One of our bots successfully processed a command. Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@keshav00001
Copy link

image
app.js
/**

  • Sample React Native App
  • https://github.com/facebook/react-native
  • @Format
  • @flow
    */
    import React, { Component } from "react";
    import { List, ListItem } from "react-native-elements";
    import {
    SafeAreaView,
    StyleSheet,
    ScrollView,
    View,
    Text,
    FlatList ,
    StatusBar,
    } from 'react-native'

class FlatListDemo extends Component {
constructor(props) {
super(props);

this.state = {
  loading: false,
  data: [],
  page: 1,
  seed: 1,
  error: null,
  refreshing: false,
};

}

componentDidMount() {
this.makeRemoteRequest();
}

makeRemoteRequest = () => {
const { page, seed } = this.state;
const url = https://randomuser.me/api/?seed=${seed}&page=${page}&results=20;
this.setState({ loading: true });
fetch(url)
.then(res => res.json())
.then(res => {
this.setState({
data: page === 1 ? res.results : [...this.state.data, ...res.results],
error: res.error || null,
loading: false,
refreshing: false
});
})
.catch(error => {
this.setState({ error, loading: false });
});
};

render() {
return (

<FlatList
data={this.state.data}
renderItem={({ item }) => (
<ListItem
roundAvatar
title={${item.name.first} ${item.name.last}}
subtitle={item.email}
avatar={{ uri: item.picture.thumbnail }}
/>
)}
/>

);

}
}

const styles = StyleSheet.create({
scrollView: {
backgroundColor: Colors.lighter,
}
});

export default FlatListDemo;

//export default App;

please help...............................................................

@react-native-bot
Copy link
Collaborator

Thanks for submitting your issue. Can you take another look at your description and make sure the issue template has been filled in its entirety?

👉 Click here if you want to take another look at the Bug Report issue template.

@react-native-bot react-native-bot added Ran Commands One of our bots successfully processed a command. Resolution: Needs More Information labels Jul 19, 2019
@kiranjd
Copy link

kiranjd commented Jul 19, 2019

Refer to this snack. I tried to reproduce the problem but it seems something is wrong with your environment. It worked in the snack without making any changes.

@stale
Copy link

stale bot commented Oct 17, 2019

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Oct 17, 2019
@stale
Copy link

stale bot commented Oct 24, 2019

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.

@stale stale bot closed this as completed Oct 24, 2019
@facebook facebook locked as resolved and limited conversation to collaborators Oct 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Component: FlatList Ran Commands One of our bots successfully processed a command. Stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

No branches or pull requests

3 participants