{"action":"closed","issue":{"url":"https://api.github.com/repos/Cloud-CV/Origami/issues/126","repository_url":"https://api.github.com/repos/Cloud-CV/Origami","labels_url":"https://api.github.com/repos/Cloud-CV/Origami/issues/126/labels{/name}","comments_url":"https://api.github.com/repos/Cloud-CV/Origami/issues/126/comments","events_url":"https://api.github.com/repos/Cloud-CV/Origami/issues/126/events","html_url":"https://github.com/Cloud-CV/Origami/issues/126","id":297221641,"node_id":"MDU6SXNzdWUyOTcyMjE2NDE=","number":126,"title":"AJAX network calls should not be in componentWillMount in react components.","user":{"login":"fristonio","id":21292343,"node_id":"MDQ6VXNlcjIxMjkyMzQz","avatar_url":"https://avatars3.githubusercontent.com/u/21292343?v=4","gravatar_id":"","url":"https://api.github.com/users/fristonio","html_url":"https://github.com/fristonio","followers_url":"https://api.github.com/users/fristonio/followers","following_url":"https://api.github.com/users/fristonio/following{/other_user}","gists_url":"https://api.github.com/users/fristonio/gists{/gist_id}","starred_url":"https://api.github.com/users/fristonio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fristonio/subscriptions","organizations_url":"https://api.github.com/users/fristonio/orgs","repos_url":"https://api.github.com/users/fristonio/repos","events_url":"https://api.github.com/users/fristonio/events{/privacy}","received_events_url":"https://api.github.com/users/fristonio/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-02-14T19:45:04Z","updated_at":"2018-11-01T11:40:19Z","closed_at":"2018-11-01T11:40:19Z","author_association":"MEMBER","body":"While working on issue #97 I found that in most of the code AJAX calls to the server are made in `componentWillMount`, while that should be avoided especially when we use `setState` in componentWillMount, here is an example.\r\nhttps://github.com/Cloud-CV/Origami/blob/master/Origami/src/components/home/HomePage.js#L81\r\nAJAX calls usually live in `componentDidMount`, not `componentWillMount`. The reason for that is that we don't want a call in an unmounted component, and when we do we are making an assumption that the data is not returned before the component mounts and setState is called.\r\n\r\nWe should port all the network related AJAX calls to `componentDidMount` from `componentWillMount`.\r\n\r\n**I would like to work on this issue.**"}}
{"actor":{"display_login":"vpn1997"}}