{"action":"created","issue":{"url":"https://api.github.com/repos/FaridSafi/react-native-gifted-listview/issues/55","repository_url":"https://api.github.com/repos/FaridSafi/react-native-gifted-listview","labels_url":"https://api.github.com/repos/FaridSafi/react-native-gifted-listview/issues/55/labels{/name}","comments_url":"https://api.github.com/repos/FaridSafi/react-native-gifted-listview/issues/55/comments","events_url":"https://api.github.com/repos/FaridSafi/react-native-gifted-listview/issues/55/events","html_url":"https://github.com/FaridSafi/react-native-gifted-listview/issues/55","id":164493785,"number":55,"title":"Render empty view","user":{"login":"Shakarang","id":8086925,"avatar_url":"https://avatars.githubusercontent.com/u/8086925?v=3","gravatar_id":"","url":"https://api.github.com/users/Shakarang","html_url":"https://github.com/Shakarang","followers_url":"https://api.github.com/users/Shakarang/followers","following_url":"https://api.github.com/users/Shakarang/following{/other_user}","gists_url":"https://api.github.com/users/Shakarang/gists{/gist_id}","starred_url":"https://api.github.com/users/Shakarang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shakarang/subscriptions","organizations_url":"https://api.github.com/users/Shakarang/orgs","repos_url":"https://api.github.com/users/Shakarang/repos","events_url":"https://api.github.com/users/Shakarang/events{/privacy}","received_events_url":"https://api.github.com/users/Shakarang/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-07-08T09:34:58Z","updated_at":"2016-07-21T13:32:51Z","closed_at":null,"body":"Hey ! \r\nI'm running your advanced example and I would like to know how to tell your list that there is no data"},"comment":{"url":"https://api.github.com/repos/FaridSafi/react-native-gifted-listview/issues/comments/234253907","html_url":"https://github.com/FaridSafi/react-native-gifted-listview/issues/55#issuecomment-234253907","issue_url":"https://api.github.com/repos/FaridSafi/react-native-gifted-listview/issues/55","id":234253907,"user":{"login":"phoenixbox","id":2892213,"avatar_url":"https://avatars.githubusercontent.com/u/2892213?v=3","gravatar_id":"","url":"https://api.github.com/users/phoenixbox","html_url":"https://github.com/phoenixbox","followers_url":"https://api.github.com/users/phoenixbox/followers","following_url":"https://api.github.com/users/phoenixbox/following{/other_user}","gists_url":"https://api.github.com/users/phoenixbox/gists{/gist_id}","starred_url":"https://api.github.com/users/phoenixbox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phoenixbox/subscriptions","organizations_url":"https://api.github.com/users/phoenixbox/orgs","repos_url":"https://api.github.com/users/phoenixbox/repos","events_url":"https://api.github.com/users/phoenixbox/events{/privacy}","received_events_url":"https://api.github.com/users/phoenixbox/received_events","type":"User","site_admin":false},"created_at":"2016-07-21T13:32:51Z","updated_at":"2016-07-21T13:32:51Z","body":"@Shakarang you can find the conditions to make the empty view render are [here](https://github.com/FaridSafi/react-native-gifted-listview/blob/9f6172d668a7e3c587c1c5d208a41b4a3c556dbe/GiftedListView.js#L283)\r\n\r\n* An empty array passed to the _onFetch function of the GiftedListView will render its empty view.\r\n* NOTE: you have to pass a function which returns a Component as the prop named `emptyView` to your GiftedListView\r\n\r\n```\r\n_onFetch(page = 1, listViewCallback, options) {\r\n    let listItems = [];\r\n    /**\r\n     * implement your logic here to replace the listItems collection with your data\r\n    */\r\n    listViewCallback(listItems);\r\n }\r\n_renderEmptyView(refreshCallback) {\r\n    return (\r\n      <View style={styles.defaultView}>\r\n        <Text style={styles.defaultViewTitle}>Nothing here!</Text>\r\n        <TouchableHighlight underlayColor='#c8c7cc'\r\n          onPress={refreshCallback}>\r\n          <Text>↻</Text>\r\n        </TouchableHighlight>\r\n      </View>\r\n    );\r\n }\r\nrender() {\r\n  return (\r\n    <GiftedListView ref={(listView) => {this._listView = listView}}\r\n    emptyView={this._renderEmptyView.bind(this)}/>\r\n  )\r\n}\r\n```"}}
{"actor":{"display_login":"phoenixbox"}}