{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/react-native/issues/4775","repository_url":"https://api.github.com/repos/facebook/react-native","labels_url":"https://api.github.com/repos/facebook/react-native/issues/4775/labels{/name}","comments_url":"https://api.github.com/repos/facebook/react-native/issues/4775/comments","events_url":"https://api.github.com/repos/facebook/react-native/issues/4775/events","html_url":"https://github.com/facebook/react-native/issues/4775","id":122170154,"number":4775,"title":"ViewPagerAndroid returns empty view when new source data added","user":{"login":"ACCTFORGH","id":9537740,"avatar_url":"https://avatars.githubusercontent.com/u/9537740?v=3","gravatar_id":"","url":"https://api.github.com/users/ACCTFORGH","html_url":"https://github.com/ACCTFORGH","followers_url":"https://api.github.com/users/ACCTFORGH/followers","following_url":"https://api.github.com/users/ACCTFORGH/following{/other_user}","gists_url":"https://api.github.com/users/ACCTFORGH/gists{/gist_id}","starred_url":"https://api.github.com/users/ACCTFORGH/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ACCTFORGH/subscriptions","organizations_url":"https://api.github.com/users/ACCTFORGH/orgs","repos_url":"https://api.github.com/users/ACCTFORGH/repos","events_url":"https://api.github.com/users/ACCTFORGH/events{/privacy}","received_events_url":"https://api.github.com/users/ACCTFORGH/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/facebook/react-native/labels/Android","name":"Android","color":"bfe5bf"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-12-15T01:19:21Z","updated_at":"2016-05-04T07:10:37Z","closed_at":null,"body":"I am currently using the ViewPagerAndroid component to do a matching/unmatching function which requires dynamic data updating in the source data of the component. The children of of the view pager is generated by a function makeItems(this.state.data) and it returns an array of keyed views. i.e. [< View key={1}/>, < View key={2}/>....] with the index being the index of the for loop that generates the array from the source data. The views contain composite views of touchable highlight but all are wrapped by a view container. I kept the data in the state of the component and whenever data updates I call setState and ViewPagerAndroid.setPage(0). The data update works fine when I reduce the data (splice) but returns an empty view for the new data when I add new data to the array. The data before the update was displayed properly.I have checked my makeItems() function that the updated data has been passed in proper. \r\n\r\n```\r\n< ViewPagerAndroid\r\n          name = 'Page Viewer 1'\r\n          style = {styles.matchingPanelViewPager}\r\n          initialPage={this.state.currentPage}\r\n          onPageSelected = {(e)=>{\r\n            console.log(e.nativeEvent.position);\r\n          }}\r\n          ref = {viewPager =>{this.viewPager = viewPager;}}>\r\n\r\n          { this.makeItems(this.state.data) }\r\n\r\n        </ ViewPagerAndroid>\r\n```\r\n\r\n\r\nI am using RN0.16.0 on Mac OS X, Genymotion, Android 4.2.2.\r\n\r\nSame issue raised in StackOverflow: http://stackoverflow.com/questions/34279503/viewpagerandroid-returns-empty-view-when-new-source-data-added\r\nThanks a lot for your help!"},"comment":{"url":"https://api.github.com/repos/facebook/react-native/issues/comments/216762897","html_url":"https://github.com/facebook/react-native/issues/4775#issuecomment-216762897","issue_url":"https://api.github.com/repos/facebook/react-native/issues/4775","id":216762897,"user":{"login":"Richard-Cao","id":5953992,"avatar_url":"https://avatars.githubusercontent.com/u/5953992?v=3","gravatar_id":"","url":"https://api.github.com/users/Richard-Cao","html_url":"https://github.com/Richard-Cao","followers_url":"https://api.github.com/users/Richard-Cao/followers","following_url":"https://api.github.com/users/Richard-Cao/following{/other_user}","gists_url":"https://api.github.com/users/Richard-Cao/gists{/gist_id}","starred_url":"https://api.github.com/users/Richard-Cao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Richard-Cao/subscriptions","organizations_url":"https://api.github.com/users/Richard-Cao/orgs","repos_url":"https://api.github.com/users/Richard-Cao/repos","events_url":"https://api.github.com/users/Richard-Cao/events{/privacy}","received_events_url":"https://api.github.com/users/Richard-Cao/received_events","type":"User","site_admin":false},"created_at":"2016-05-04T07:10:37Z","updated_at":"2016-05-04T07:10:37Z","body":"any solution?"}}