{"action":"created","issue":{"url":"https://api.github.com/repos/whoisandie/react-blocks/issues/5","labels_url":"https://api.github.com/repos/whoisandie/react-blocks/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/whoisandie/react-blocks/issues/5/comments","events_url":"https://api.github.com/repos/whoisandie/react-blocks/issues/5/events","html_url":"https://github.com/whoisandie/react-blocks/issues/5","id":105098548,"number":5,"title":"Components inside Block do not re-render when state changes","user":{"login":"khaledh","id":2148408,"avatar_url":"https://avatars.githubusercontent.com/u/2148408?v=3","gravatar_id":"","url":"https://api.github.com/users/khaledh","html_url":"https://github.com/khaledh","followers_url":"https://api.github.com/users/khaledh/followers","following_url":"https://api.github.com/users/khaledh/following{/other_user}","gists_url":"https://api.github.com/users/khaledh/gists{/gist_id}","starred_url":"https://api.github.com/users/khaledh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/khaledh/subscriptions","organizations_url":"https://api.github.com/users/khaledh/orgs","repos_url":"https://api.github.com/users/khaledh/repos","events_url":"https://api.github.com/users/khaledh/events{/privacy}","received_events_url":"https://api.github.com/users/khaledh/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-09-06T14:52:12Z","updated_at":"2015-09-06T15:15:29Z","closed_at":null,"body":"Given the following:\r\n\r\n```javascript\r\nimport React from 'react';\r\nimport Block from 'react-blocks';\r\n\r\nclass Test extends React.Component {\r\n  constructor(props) {\r\n    super(props);\r\n    this.state = { message: 'hello (initial)' };\r\n  }\r\n\r\n  render() {\r\n    return (\r\n      <div>\r\n        <a href=\"#\" onClick={() => this.setState({ message: 'hello (modified)'})}>click me</a><br />\r\n        state outside Block: {this.state.message}\r\n        <Block layout horizontal>\r\n          <Block>state inside Block: {this.state.message}</Block>\r\n        </Block>\r\n      </div>\r\n    );\r\n  }\r\n}\r\n```\r\n\r\nThe initial output is:\r\n```\r\nstate outside Block: hello (initial)\r\nstate inside Block: hello (initial)\r\n```\r\n\r\nAnd after I click the \"click me\" link:\r\n```\r\nstate outside Block: hello (modified)\r\nstate inside Block: hello (initial)\r\n```\r\n\r\nLooks like a bug. If not, then how can I force the contents of Block to re-render when state changes?"},"comment":{"url":"https://api.github.com/repos/whoisandie/react-blocks/issues/comments/138092273","html_url":"https://github.com/whoisandie/react-blocks/issues/5#issuecomment-138092273","issue_url":"https://api.github.com/repos/whoisandie/react-blocks/issues/5","id":138092273,"user":{"login":"khaledh","id":2148408,"avatar_url":"https://avatars.githubusercontent.com/u/2148408?v=3","gravatar_id":"","url":"https://api.github.com/users/khaledh","html_url":"https://github.com/khaledh","followers_url":"https://api.github.com/users/khaledh/followers","following_url":"https://api.github.com/users/khaledh/following{/other_user}","gists_url":"https://api.github.com/users/khaledh/gists{/gist_id}","starred_url":"https://api.github.com/users/khaledh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/khaledh/subscriptions","organizations_url":"https://api.github.com/users/khaledh/orgs","repos_url":"https://api.github.com/users/khaledh/repos","events_url":"https://api.github.com/users/khaledh/events{/privacy}","received_events_url":"https://api.github.com/users/khaledh/received_events","type":"User","site_admin":false},"created_at":"2015-09-06T15:15:29Z","updated_at":"2015-09-06T15:15:29Z","body":"I narrowed it down to this the [shouldComponentUpdate()](https://github.com/whoisandie/react-blocks/blob/master/src%2Fdecorate.js#L36-L41) method in decorate.js. It looks like it's not going to re-render unless the `_media` state changes.\r\n\r\nNot sure how to fix this, but if I force shouldComponentUpdate to always return true, then my components inside Block re-render on state change properly."}}