{"action":"created","issue":{"url":"https://api.github.com/repos/fritz-c/react-sortable-tree/issues/26","repository_url":"https://api.github.com/repos/fritz-c/react-sortable-tree","labels_url":"https://api.github.com/repos/fritz-c/react-sortable-tree/issues/26/labels{/name}","comments_url":"https://api.github.com/repos/fritz-c/react-sortable-tree/issues/26/comments","events_url":"https://api.github.com/repos/fritz-c/react-sortable-tree/issues/26/events","html_url":"https://github.com/fritz-c/react-sortable-tree/issues/26","id":192981356,"number":26,"title":"Modifying treeData in state does not trigger an onChange or other event. ","user":{"login":"mojo5000","id":123468,"avatar_url":"https://avatars.githubusercontent.com/u/123468?v=3","gravatar_id":"","url":"https://api.github.com/users/mojo5000","html_url":"https://github.com/mojo5000","followers_url":"https://api.github.com/users/mojo5000/followers","following_url":"https://api.github.com/users/mojo5000/following{/other_user}","gists_url":"https://api.github.com/users/mojo5000/gists{/gist_id}","starred_url":"https://api.github.com/users/mojo5000/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mojo5000/subscriptions","organizations_url":"https://api.github.com/users/mojo5000/orgs","repos_url":"https://api.github.com/users/mojo5000/repos","events_url":"https://api.github.com/users/mojo5000/events{/privacy}","received_events_url":"https://api.github.com/users/mojo5000/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-12-01T22:32:55Z","updated_at":"2016-12-02T01:59:37Z","closed_at":null,"body":"Adding a node to the treeData outside of the component and modifying state.  I'd like it to trigger a event to know that data has changed.  It takes expanding/collapsing or moving an item for the UI to reflect this.\r\n\r\nIdeally this should happen when state changes (treeData).  Am I doing something dumb?  Do I have to explicitly trigger an event?\r\n\r\nAny help appreciated, thanks."},"comment":{"url":"https://api.github.com/repos/fritz-c/react-sortable-tree/issues/comments/264352975","html_url":"https://github.com/fritz-c/react-sortable-tree/issues/26#issuecomment-264352975","issue_url":"https://api.github.com/repos/fritz-c/react-sortable-tree/issues/26","id":264352975,"user":{"login":"fritz-c","id":4413963,"avatar_url":"https://avatars.githubusercontent.com/u/4413963?v=3","gravatar_id":"","url":"https://api.github.com/users/fritz-c","html_url":"https://github.com/fritz-c","followers_url":"https://api.github.com/users/fritz-c/followers","following_url":"https://api.github.com/users/fritz-c/following{/other_user}","gists_url":"https://api.github.com/users/fritz-c/gists{/gist_id}","starred_url":"https://api.github.com/users/fritz-c/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fritz-c/subscriptions","organizations_url":"https://api.github.com/users/fritz-c/orgs","repos_url":"https://api.github.com/users/fritz-c/repos","events_url":"https://api.github.com/users/fritz-c/events{/privacy}","received_events_url":"https://api.github.com/users/fritz-c/received_events","type":"User","site_admin":false},"created_at":"2016-12-02T01:59:37Z","updated_at":"2016-12-02T01:59:37Z","body":"Glad to hear!\r\nMore so than my library, I think it might have something to do with how React detects changes in state. Assigning new values to an object without recreating it makes it so the previous reference is unchanged, and objects are passed around by reference (I think).\r\n\r\nHere's a little proof-of-concept from the terminal:\r\n```\r\n$ node\r\n> a = {b: 1}\r\n{ b: 1 }\r\n> c = a\r\n{ b: 1 }\r\n> c.b = 2\r\n2\r\n> a === c\r\ntrue\r\n```"}}
{"actor":{"display_login":"fritz-c"}}