{"action":"created","issue":{"url":"https://api.github.com/repos/slamdata/purescript-halogen/issues/227","labels_url":"https://api.github.com/repos/slamdata/purescript-halogen/issues/227/labels{/name}","comments_url":"https://api.github.com/repos/slamdata/purescript-halogen/issues/227/comments","events_url":"https://api.github.com/repos/slamdata/purescript-halogen/issues/227/events","html_url":"https://github.com/slamdata/purescript-halogen/issues/227","id":114230839,"number":227,"title":"Feature similar to React's props?","user":{"login":"themoritz","id":3522732,"avatar_url":"https://avatars.githubusercontent.com/u/3522732?v=3","gravatar_id":"","url":"https://api.github.com/users/themoritz","html_url":"https://github.com/themoritz","followers_url":"https://api.github.com/users/themoritz/followers","following_url":"https://api.github.com/users/themoritz/following{/other_user}","gists_url":"https://api.github.com/users/themoritz/gists{/gist_id}","starred_url":"https://api.github.com/users/themoritz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/themoritz/subscriptions","organizations_url":"https://api.github.com/users/themoritz/orgs","repos_url":"https://api.github.com/users/themoritz/repos","events_url":"https://api.github.com/users/themoritz/events{/privacy}","received_events_url":"https://api.github.com/users/themoritz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-10-30T09:22:15Z","updated_at":"2015-10-30T11:32:29Z","closed_at":null,"body":"React components have \"props\", which are a convenient and declarative way of passing state information read-only from parent to child component:\r\n```coffeescript\r\nParent = React.createClass\r\n  getInitialState: ->\r\n    msg: \"Foo\"\r\n  render: ->\r\n    <div><Child content={@state.msg}></div>\r\n\r\nChild = React.createClass\r\n  render: ->\r\n    <p>{@props.content}</p>\r\n```\r\nThe interesting thing being that `Child` re-renders automatically when the state of `Parent` changes. Is something like this possible in halogen / could it be possible in future versions?\r\n\r\nThe alternative to props is replicating part of the parent's state in the child and then sending update actions to the child whenever the parent's state changes. This is not declarative and you get the typical bugs where you forget updating the child's state, etc."},"comment":{"url":"https://api.github.com/repos/slamdata/purescript-halogen/issues/comments/152500855","html_url":"https://github.com/slamdata/purescript-halogen/issues/227#issuecomment-152500855","issue_url":"https://api.github.com/repos/slamdata/purescript-halogen/issues/227","id":152500855,"user":{"login":"themoritz","id":3522732,"avatar_url":"https://avatars.githubusercontent.com/u/3522732?v=3","gravatar_id":"","url":"https://api.github.com/users/themoritz","html_url":"https://github.com/themoritz","followers_url":"https://api.github.com/users/themoritz/followers","following_url":"https://api.github.com/users/themoritz/following{/other_user}","gists_url":"https://api.github.com/users/themoritz/gists{/gist_id}","starred_url":"https://api.github.com/users/themoritz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/themoritz/subscriptions","organizations_url":"https://api.github.com/users/themoritz/orgs","repos_url":"https://api.github.com/users/themoritz/repos","events_url":"https://api.github.com/users/themoritz/events{/privacy}","received_events_url":"https://api.github.com/users/themoritz/received_events","type":"User","site_admin":false},"created_at":"2015-10-30T11:32:29Z","updated_at":"2015-10-30T11:32:29Z","body":"I see, this works because the placeholder is not part of the thunk. Wouldn't the implication then be that the state of the child component will be reset when the placeholder changes?\r\n\r\nWhat I'd love to have is that the child component operates in some sort of closure that is defined by the parent and changes with the parent's state."}}