{"action":"opened","issue":{"url":"https://api.github.com/repos/Bhoos/react-native-coverflow/issues/1","repository_url":"https://api.github.com/repos/Bhoos/react-native-coverflow","labels_url":"https://api.github.com/repos/Bhoos/react-native-coverflow/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/Bhoos/react-native-coverflow/issues/1/comments","events_url":"https://api.github.com/repos/Bhoos/react-native-coverflow/issues/1/events","html_url":"https://github.com/Bhoos/react-native-coverflow/issues/1","id":231339160,"number":1,"title":"Children not re-rendering upon state change?","user":{"login":"DavideValdo","id":26572302,"avatar_url":"https://avatars2.githubusercontent.com/u/26572302?v=3","gravatar_id":"","url":"https://api.github.com/users/DavideValdo","html_url":"https://github.com/DavideValdo","followers_url":"https://api.github.com/users/DavideValdo/followers","following_url":"https://api.github.com/users/DavideValdo/following{/other_user}","gists_url":"https://api.github.com/users/DavideValdo/gists{/gist_id}","starred_url":"https://api.github.com/users/DavideValdo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DavideValdo/subscriptions","organizations_url":"https://api.github.com/users/DavideValdo/orgs","repos_url":"https://api.github.com/users/DavideValdo/repos","events_url":"https://api.github.com/users/DavideValdo/events{/privacy}","received_events_url":"https://api.github.com/users/DavideValdo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-05-25T13:26:36Z","updated_at":"2017-05-25T13:26:36Z","closed_at":null,"body":"This the behaviour: https://giphy.com/gifs/xUPGcAd4NctowQAzsc/html5\r\nAs you can see, triggering a re-render seems not to be working and the star button remains the same color, unless I change the current selected segment.\r\n\r\nThis is how I'm managing state:\r\n1. My _PictureThumb_ component changes the \"Model\" which emit events\r\n2. My _Gallery_ component listens to the event and correctly updates internal state through setState();\r\n\r\nUpdated products (with a new or nulled bookmarkID) are mapped to every _PictureThumb_'s props. Methods from the _Gallery_ component:\r\n\r\n```\r\n  _renderGallery () \r\n    gallery = new Array();\r\n\r\n    this.state.products.map((p) => {\r\n      gallery.push(\r\n        <PictureThumb product={p} />\r\n      );\r\n    });\r\n\r\n    return gallery;\r\n  }\r\n\r\n_showAllProducts () {\r\n    return (\r\n        <ScrollView>\r\n            <View style={{flex: 1, flexWrap: 'wrap', flexDirection: 'row'}}>\r\n               {this._renderGallery()}\r\n            </View>\r\n        </ScrollView>\r\n    )\r\n  }\r\n```\r\n\r\nThis is the 'FEATURED' part, that gets correctly re-rendered only if I change segment:\r\n\r\n```\r\n _renderFeaturedGallery () {\r\n    console.debug(\"Rerendering coverflow with state\", this.state.products);\r\n    gallery = new Array();\r\n\r\n    this.state.products.filter((p) => {return p.featured}).map((p) => {\r\n      gallery.push(<PictureThumb product={p} />);\r\n    })\r\n\r\n    return gallery;\r\n  }\r\n\r\n_showFeatured () {\r\n    return (\r\n      <Coverflow style={{marginTop: 20}} onChange={(index) => {}}>\r\n        {this._renderFeaturedGallery()}\r\n      </Coverflow>\r\n    )\r\n  }\r\n```\r\n**_renderFeaturedGallery() launches console.debug(\"Rerendering coverflow with state\", this.state.products), which shows the correctly updated state!**\r\n\r\nSo, is it not re-rendering because of the component?\r\n"}}
{"actor":{"display_login":"DavideValdo"}}