{"action":"created","issue":{"url":"https://api.github.com/repos/pqina/react-filepond/issues/2","repository_url":"https://api.github.com/repos/pqina/react-filepond","labels_url":"https://api.github.com/repos/pqina/react-filepond/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/pqina/react-filepond/issues/2/comments","events_url":"https://api.github.com/repos/pqina/react-filepond/issues/2/events","html_url":"https://github.com/pqina/react-filepond/issues/2","id":306198085,"number":2,"title":"FilePond - Issue when component is unmounted","user":{"login":"svaldi","id":5630268,"avatar_url":"https://avatars2.githubusercontent.com/u/5630268?v=4","gravatar_id":"","url":"https://api.github.com/users/svaldi","html_url":"https://github.com/svaldi","followers_url":"https://api.github.com/users/svaldi/followers","following_url":"https://api.github.com/users/svaldi/following{/other_user}","gists_url":"https://api.github.com/users/svaldi/gists{/gist_id}","starred_url":"https://api.github.com/users/svaldi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/svaldi/subscriptions","organizations_url":"https://api.github.com/users/svaldi/orgs","repos_url":"https://api.github.com/users/svaldi/repos","events_url":"https://api.github.com/users/svaldi/events{/privacy}","received_events_url":"https://api.github.com/users/svaldi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-17T23:08:03Z","updated_at":"2018-03-18T13:03:15Z","closed_at":null,"author_association":"NONE","body":"Hello, \r\n\r\nI'm testing the React Component and something caught my attention, while I was unmounting a component where the File Pond component has been mounted before it throws an error: \r\n\r\n```\r\nUncaught TypeError: Cannot read property 'restoreElement' of undefined\r\n    at destroy (filepond.js:7904)\r\n    at filepond.js:1957\r\n    at Array.forEach (<anonymous>)\r\n    at filepond.js:1956\r\n```\r\n\r\n```\r\n// destroys apps and removes them from the app array\r\n  var destroy = function destroy(hook) {\r\n    // returns true if the app was destroyed successfully\r\n    var indexToRemove = state.apps.findIndex(function(app) {\r\n      return app.isAttachedTo(hook);\r\n    });\r\n    if (\r\n      function(indexToRemove) {\r\n        return 0;\r\n      }\r\n    ) {\r\n      // remove from apps\r\n      var app = state.apps.splice(indexToRemove, 1)[0];\r\n\r\n      // restore original dom element\r\nLine: 7904      app.restoreElement();\r\n\r\n      return true;\r\n    }\r\n\r\n    return false;\r\n  };\r\n\r\n```\r\n\r\nTested on: \r\n\r\n> Google Chrome\r\n> Version 65.0.3325.162 (Official Build) (64-bit)\r\n\r\nYour component is great!! \r\n"},"comment":{"url":"https://api.github.com/repos/pqina/react-filepond/issues/comments/373997074","html_url":"https://github.com/pqina/react-filepond/issues/2#issuecomment-373997074","issue_url":"https://api.github.com/repos/pqina/react-filepond/issues/2","id":373997074,"user":{"login":"rikschennink","id":1132575,"avatar_url":"https://avatars2.githubusercontent.com/u/1132575?v=4","gravatar_id":"","url":"https://api.github.com/users/rikschennink","html_url":"https://github.com/rikschennink","followers_url":"https://api.github.com/users/rikschennink/followers","following_url":"https://api.github.com/users/rikschennink/following{/other_user}","gists_url":"https://api.github.com/users/rikschennink/gists{/gist_id}","starred_url":"https://api.github.com/users/rikschennink/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rikschennink/subscriptions","organizations_url":"https://api.github.com/users/rikschennink/orgs","repos_url":"https://api.github.com/users/rikschennink/repos","events_url":"https://api.github.com/users/rikschennink/events{/privacy}","received_events_url":"https://api.github.com/users/rikschennink/received_events","type":"User","site_admin":false},"created_at":"2018-03-18T13:03:15Z","updated_at":"2018-03-18T13:03:15Z","author_association":"COLLABORATOR","body":"@svaldi Thanks for reporting! I've reproduced the issue, hope to push a fix tomorrow."}}
{"actor":{"display_login":"rikschennink"}}