{"action":"created","issue":{"url":"https://api.github.com/repos/rackt/react-router/issues/1546","labels_url":"https://api.github.com/repos/rackt/react-router/issues/1546/labels{/name}","comments_url":"https://api.github.com/repos/rackt/react-router/issues/1546/comments","events_url":"https://api.github.com/repos/rackt/react-router/issues/1546/events","html_url":"https://github.com/rackt/react-router/issues/1546","id":95138543,"number":1546,"title":"setState doesn't raise createElement","user":{"login":"omerts","id":4996164,"avatar_url":"https://avatars.githubusercontent.com/u/4996164?v=3","gravatar_id":"","url":"https://api.github.com/users/omerts","html_url":"https://github.com/omerts","followers_url":"https://api.github.com/users/omerts/followers","following_url":"https://api.github.com/users/omerts/following{/other_user}","gists_url":"https://api.github.com/users/omerts/gists{/gist_id}","starred_url":"https://api.github.com/users/omerts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/omerts/subscriptions","organizations_url":"https://api.github.com/users/omerts/orgs","repos_url":"https://api.github.com/users/omerts/repos","events_url":"https://api.github.com/users/omerts/events{/privacy}","received_events_url":"https://api.github.com/users/omerts/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-07-15T08:52:54Z","updated_at":"2015-07-27T18:11:21Z","closed_at":null,"body":"I have a route handler called App, which has sub-routes. \r\nMy render method looks like  this:\r\n```javascript\r\nrender() {  \r\n    return (\r\n      <AppCanvas predefinedLayout={1}>\r\n        {this.props.children}\r\n      </AppCanvas>\r\n    );\r\n  }\r\n```\r\nI am injecting props to children through the Router's createElement method. \r\nI don't want to use React.cloneElement bcs imho it is an antipattern, and is not the way to transfer props to children.\r\nIf I call setState from inside my App, createElement isn't raised. "},"comment":{"url":"https://api.github.com/repos/rackt/react-router/issues/comments/125291975","html_url":"https://github.com/rackt/react-router/issues/1546#issuecomment-125291975","issue_url":"https://api.github.com/repos/rackt/react-router/issues/1546","id":125291975,"user":{"login":"taurose","id":1550663,"avatar_url":"https://avatars.githubusercontent.com/u/1550663?v=3","gravatar_id":"","url":"https://api.github.com/users/taurose","html_url":"https://github.com/taurose","followers_url":"https://api.github.com/users/taurose/followers","following_url":"https://api.github.com/users/taurose/following{/other_user}","gists_url":"https://api.github.com/users/taurose/gists{/gist_id}","starred_url":"https://api.github.com/users/taurose/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/taurose/subscriptions","organizations_url":"https://api.github.com/users/taurose/orgs","repos_url":"https://api.github.com/users/taurose/repos","events_url":"https://api.github.com/users/taurose/events{/privacy}","received_events_url":"https://api.github.com/users/taurose/received_events","type":"User","site_admin":false},"created_at":"2015-07-27T18:11:21Z","updated_at":"2015-07-27T18:11:21Z","body":"I think he's just looking for a way to pass state down from one handler to the next, i.e. `<RouteHandler someProp={this.state.something} />` without using `cloneElement`. IIRC I suggested using `createElement` hook since I thought the state was managed outside.\r\n\r\nI can't think of any simple solution. Ideally, I think, you should pull that state out of React (or at least `<Router>`)  into a flux store or a simple observable, and then pass actions and the subscription method using `createElement`. Instead of subscribing, it might be better to just pass the data and rerender `<Router>` on change (which could be implemented as a React component if you don't care about server rendering), but I'm not sure if the current API is up for that."}}