{"action":"created","issue":{"url":"https://api.github.com/repos/lolatravel/realm-react-redux/issues/14","repository_url":"https://api.github.com/repos/lolatravel/realm-react-redux","labels_url":"https://api.github.com/repos/lolatravel/realm-react-redux/issues/14/labels{/name}","comments_url":"https://api.github.com/repos/lolatravel/realm-react-redux/issues/14/comments","events_url":"https://api.github.com/repos/lolatravel/realm-react-redux/issues/14/events","html_url":"https://github.com/lolatravel/realm-react-redux/issues/14","id":294476324,"number":14,"title":"Error: Cannot create asynchronous query while in a write transaction","user":{"login":"tofoli","id":2599384,"avatar_url":"https://avatars2.githubusercontent.com/u/2599384?v=4","gravatar_id":"","url":"https://api.github.com/users/tofoli","html_url":"https://github.com/tofoli","followers_url":"https://api.github.com/users/tofoli/followers","following_url":"https://api.github.com/users/tofoli/following{/other_user}","gists_url":"https://api.github.com/users/tofoli/gists{/gist_id}","starred_url":"https://api.github.com/users/tofoli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tofoli/subscriptions","organizations_url":"https://api.github.com/users/tofoli/orgs","repos_url":"https://api.github.com/users/tofoli/repos","events_url":"https://api.github.com/users/tofoli/events{/privacy}","received_events_url":"https://api.github.com/users/tofoli/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"lamflam","id":3680882,"avatar_url":"https://avatars3.githubusercontent.com/u/3680882?v=4","gravatar_id":"","url":"https://api.github.com/users/lamflam","html_url":"https://github.com/lamflam","followers_url":"https://api.github.com/users/lamflam/followers","following_url":"https://api.github.com/users/lamflam/following{/other_user}","gists_url":"https://api.github.com/users/lamflam/gists{/gist_id}","starred_url":"https://api.github.com/users/lamflam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lamflam/subscriptions","organizations_url":"https://api.github.com/users/lamflam/orgs","repos_url":"https://api.github.com/users/lamflam/repos","events_url":"https://api.github.com/users/lamflam/events{/privacy}","received_events_url":"https://api.github.com/users/lamflam/received_events","type":"User","site_admin":false},"assignees":[{"login":"lamflam","id":3680882,"avatar_url":"https://avatars3.githubusercontent.com/u/3680882?v=4","gravatar_id":"","url":"https://api.github.com/users/lamflam","html_url":"https://github.com/lamflam","followers_url":"https://api.github.com/users/lamflam/followers","following_url":"https://api.github.com/users/lamflam/following{/other_user}","gists_url":"https://api.github.com/users/lamflam/gists{/gist_id}","starred_url":"https://api.github.com/users/lamflam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lamflam/subscriptions","organizations_url":"https://api.github.com/users/lamflam/orgs","repos_url":"https://api.github.com/users/lamflam/repos","events_url":"https://api.github.com/users/lamflam/events{/privacy}","received_events_url":"https://api.github.com/users/lamflam/received_events","type":"User","site_admin":false}],"milestone":null,"comments":3,"created_at":"2018-02-05T17:26:32Z","updated_at":"2018-02-28T17:17:29Z","closed_at":null,"author_association":"NONE","body":"This error is located at:\r\n```js\r\nconst mapPropsToQueries = (realm, ownProps) => {\r\n  return [\r\n    realm.objects('Category'), // <--- This line\r\n  ];\r\n};\r\n```\r\n\r\nMy writer:\r\n```js\r\n\r\nexport default (realm, action) => {\r\n  switch (action.type) {\r\n    case 'FETCH_JSON':\r\n      realm.delete(realm.objects('Category'));\r\n\r\n      action.payload.Categories.forEach(category => {\r\n        realm.create('Category', category);\r\n      });\r\n\r\n      break;\r\n  }\r\n}\r\n\r\n```\r\n\r\nAny solution?"},"comment":{"url":"https://api.github.com/repos/lolatravel/realm-react-redux/issues/comments/369312848","html_url":"https://github.com/lolatravel/realm-react-redux/issues/14#issuecomment-369312848","issue_url":"https://api.github.com/repos/lolatravel/realm-react-redux/issues/14","id":369312848,"user":{"login":"tofoli","id":2599384,"avatar_url":"https://avatars2.githubusercontent.com/u/2599384?v=4","gravatar_id":"","url":"https://api.github.com/users/tofoli","html_url":"https://github.com/tofoli","followers_url":"https://api.github.com/users/tofoli/followers","following_url":"https://api.github.com/users/tofoli/following{/other_user}","gists_url":"https://api.github.com/users/tofoli/gists{/gist_id}","starred_url":"https://api.github.com/users/tofoli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tofoli/subscriptions","organizations_url":"https://api.github.com/users/tofoli/orgs","repos_url":"https://api.github.com/users/tofoli/repos","events_url":"https://api.github.com/users/tofoli/events{/privacy}","received_events_url":"https://api.github.com/users/tofoli/received_events","type":"User","site_admin":false},"created_at":"2018-02-28T17:17:29Z","updated_at":"2018-02-28T17:17:29Z","author_association":"NONE","body":"Yes @lamflam "}}
{"actor":{"display_login":"tofoli"}}