{"action":"created","issue":{"url":"https://api.github.com/repos/gitim/react-native-sortable-list/issues/79","repository_url":"https://api.github.com/repos/gitim/react-native-sortable-list","labels_url":"https://api.github.com/repos/gitim/react-native-sortable-list/issues/79/labels{/name}","comments_url":"https://api.github.com/repos/gitim/react-native-sortable-list/issues/79/comments","events_url":"https://api.github.com/repos/gitim/react-native-sortable-list/issues/79/events","html_url":"https://github.com/gitim/react-native-sortable-list/issues/79","id":280368930,"node_id":"MDU6SXNzdWUyODAzNjg5MzA=","number":79,"title":"Not Rendering The Data After Added A New Data Into Sortable List","user":{"login":"chongzheng1995","id":27880708,"node_id":"MDQ6VXNlcjI3ODgwNzA4","avatar_url":"https://avatars3.githubusercontent.com/u/27880708?v=4","gravatar_id":"","url":"https://api.github.com/users/chongzheng1995","html_url":"https://github.com/chongzheng1995","followers_url":"https://api.github.com/users/chongzheng1995/followers","following_url":"https://api.github.com/users/chongzheng1995/following{/other_user}","gists_url":"https://api.github.com/users/chongzheng1995/gists{/gist_id}","starred_url":"https://api.github.com/users/chongzheng1995/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chongzheng1995/subscriptions","organizations_url":"https://api.github.com/users/chongzheng1995/orgs","repos_url":"https://api.github.com/users/chongzheng1995/repos","events_url":"https://api.github.com/users/chongzheng1995/events{/privacy}","received_events_url":"https://api.github.com/users/chongzheng1995/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-12-08T04:40:51Z","updated_at":"2018-07-24T10:53:43Z","closed_at":null,"author_association":"NONE","body":"Hello,\r\n\r\nGood day and thanks for this awesome package. I am new to this React Native project. The followings are my datasource for the Sortable List.\r\n\r\n`const data = {`\r\n     ` 0 : {'id' : 'img1', 'imgsrc' : require('../img/food.png'), 'name':'Food'},`\r\n     ` 1 : {'id' : 'img2', 'imgsrc' : require('../img/drink.png'), 'name':'Drink'},`\r\n     ` 2 : {'id' : 'img3', 'imgsrc' : require('../img/building.png'), 'name':'Building'},`\r\n     ` 3 : {'id' : 'img4', 'imgsrc' : require('../img/shop.png'), 'name':'Store'},`\r\n     ` 4 : {'id' : 'img5', 'imgsrc' : require('../img/inventory.png'), 'name':'Inventory'},`\r\n`}` \r\n\r\nThen, I created sortable list which successfully display all the items in the list as shown in below.\r\n![Uploading ^9146803855146ED6D9EFA0676085AA998B2E266DFB496E8ADD^pimgpsh_mobile_save_distr.jpg…]()\r\n\r\nHowever, when I added one item by the following function, the Sortable List does not render the new data.\r\n\r\n`insertItem = (newId, newImgsrc, newName) => {`\r\n`newItem = {'id': newId, 'imgsrc': newImgsrc, 'name': 'newName'};`\r\n`length = Object.keys(this.state.data).length;`\r\n`let tempdata = this.state.data;`\r\n`tempdata[length] = newItem;`\r\n`this.setState({data:tempdata});`\r\n`}`\r\n\r\nThe Sortable List remained the same after adding new item. After inspection, I verified that there is additional data inside the this.state.data.\r\n\r\n**Expected Output: Sortable List should render the new data**\r\n**Actual Output: Sortable List does not render the new data**\r\n\r\n**What Have I Tried:**\r\n1. I have tried setState for the order variable to the whole list with additional data. Then, I encountered error of 'undefined is not an object (evaluating 'rowsLayout[key].height').\r\n\r\nThank you for your time and sorry for my lack of knowledge in React-Native.\r\n\r\n "},"comment":{"url":"https://api.github.com/repos/gitim/react-native-sortable-list/issues/comments/407365063","html_url":"https://github.com/gitim/react-native-sortable-list/issues/79#issuecomment-407365063","issue_url":"https://api.github.com/repos/gitim/react-native-sortable-list/issues/79","id":407365063,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNzM2NTA2Mw==","user":{"login":"amed","id":5637272,"node_id":"MDQ6VXNlcjU2MzcyNzI=","avatar_url":"https://avatars3.githubusercontent.com/u/5637272?v=4","gravatar_id":"","url":"https://api.github.com/users/amed","html_url":"https://github.com/amed","followers_url":"https://api.github.com/users/amed/followers","following_url":"https://api.github.com/users/amed/following{/other_user}","gists_url":"https://api.github.com/users/amed/gists{/gist_id}","starred_url":"https://api.github.com/users/amed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amed/subscriptions","organizations_url":"https://api.github.com/users/amed/orgs","repos_url":"https://api.github.com/users/amed/repos","events_url":"https://api.github.com/users/amed/events{/privacy}","received_events_url":"https://api.github.com/users/amed/received_events","type":"User","site_admin":false},"created_at":"2018-07-24T10:53:43Z","updated_at":"2018-07-24T10:53:43Z","author_association":"NONE","body":"use es6 concatenating shortcut:\r\n\r\n```\r\ntheHandler() {\r\n    this.setState({\r\n      stateName: [...this.state.stateName, newItem]\r\n    })\r\n  }\r\n```"}}
{"actor":{"display_login":"amed"}}