{"action":"created","issue":{"url":"https://api.github.com/repos/STRML/react-grid-layout/issues/619","repository_url":"https://api.github.com/repos/STRML/react-grid-layout","labels_url":"https://api.github.com/repos/STRML/react-grid-layout/issues/619/labels{/name}","comments_url":"https://api.github.com/repos/STRML/react-grid-layout/issues/619/comments","events_url":"https://api.github.com/repos/STRML/react-grid-layout/issues/619/events","html_url":"https://github.com/STRML/react-grid-layout/issues/619","id":254860659,"number":619,"title":"Reset Layout does not re-render the layout","user":{"login":"merttoka","id":17174049,"avatar_url":"https://avatars2.githubusercontent.com/u/17174049?v=4","gravatar_id":"","url":"https://api.github.com/users/merttoka","html_url":"https://github.com/merttoka","followers_url":"https://api.github.com/users/merttoka/followers","following_url":"https://api.github.com/users/merttoka/following{/other_user}","gists_url":"https://api.github.com/users/merttoka/gists{/gist_id}","starred_url":"https://api.github.com/users/merttoka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/merttoka/subscriptions","organizations_url":"https://api.github.com/users/merttoka/orgs","repos_url":"https://api.github.com/users/merttoka/repos","events_url":"https://api.github.com/users/merttoka/events{/privacy}","received_events_url":"https://api.github.com/users/merttoka/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-09-03T08:16:27Z","updated_at":"2017-10-25T16:20:07Z","closed_at":null,"author_association":"NONE","body":"I am not sure if I am doing the wrong thing or if this is a bug but definitely something is off here. I have a `resetLayout` function which updates the `data-grid` entries in the state using the `setState` function. The `data-grid` entries are reading their values from `this.state.layout`. However, nothing happens when `resetLayout` function gets called. Why `this.setState` doesn't affect the render at all?\r\n\r\nThanks for submitting an issue to RGL!\r\n\r\nPlease mark the type of this issue:\r\n\r\n- [x] Bug\r\n- [ ] Feature Request\r\n- [x] Question\r\n\r\nIf you have a question or bug report, please use the [WebpackBin Template](http://www.webpackbin.com/EJF48h_rz)\r\nto demonstrate. It is much easier for us to help you if you do.\r\n"},"comment":{"url":"https://api.github.com/repos/STRML/react-grid-layout/issues/comments/339386475","html_url":"https://github.com/STRML/react-grid-layout/issues/619#issuecomment-339386475","issue_url":"https://api.github.com/repos/STRML/react-grid-layout/issues/619","id":339386475,"user":{"login":"merttoka","id":17174049,"avatar_url":"https://avatars2.githubusercontent.com/u/17174049?v=4","gravatar_id":"","url":"https://api.github.com/users/merttoka","html_url":"https://github.com/merttoka","followers_url":"https://api.github.com/users/merttoka/followers","following_url":"https://api.github.com/users/merttoka/following{/other_user}","gists_url":"https://api.github.com/users/merttoka/gists{/gist_id}","starred_url":"https://api.github.com/users/merttoka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/merttoka/subscriptions","organizations_url":"https://api.github.com/users/merttoka/orgs","repos_url":"https://api.github.com/users/merttoka/repos","events_url":"https://api.github.com/users/merttoka/events{/privacy}","received_events_url":"https://api.github.com/users/merttoka/received_events","type":"User","site_admin":false},"created_at":"2017-10-25T16:20:07Z","updated_at":"2017-10-25T16:20:07Z","author_association":"NONE","body":"I used a workaround to solve the problem. I read something in Github issues that layouts get re-rendered only when the _number of layouts changes_ rather than data-grid items receiving manipulations. That's why whenever I need a re-render, I either add or delete a dummy layout and I keep track of its ID so that I don't actually end up drawing it on the page in the `render` function.\r\n\r\nIs it the best solution, possibly not but it works so far."}}
{"actor":{"display_login":"merttoka"}}