{"action":"created","issue":{"url":"https://api.github.com/repos/ga-wdi-exercises/project4/issues/414","repository_url":"https://api.github.com/repos/ga-wdi-exercises/project4","labels_url":"https://api.github.com/repos/ga-wdi-exercises/project4/issues/414/labels{/name}","comments_url":"https://api.github.com/repos/ga-wdi-exercises/project4/issues/414/comments","events_url":"https://api.github.com/repos/ga-wdi-exercises/project4/issues/414/events","html_url":"https://github.com/ga-wdi-exercises/project4/issues/414","id":196757975,"number":414,"title":"Child component can't call prop function from parent component","user":{"login":"nguyendthinh","id":21368549,"avatar_url":"https://avatars.githubusercontent.com/u/21368549?v=3","gravatar_id":"","url":"https://api.github.com/users/nguyendthinh","html_url":"https://github.com/nguyendthinh","followers_url":"https://api.github.com/users/nguyendthinh/followers","following_url":"https://api.github.com/users/nguyendthinh/following{/other_user}","gists_url":"https://api.github.com/users/nguyendthinh/gists{/gist_id}","starred_url":"https://api.github.com/users/nguyendthinh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nguyendthinh/subscriptions","organizations_url":"https://api.github.com/users/nguyendthinh/orgs","repos_url":"https://api.github.com/users/nguyendthinh/repos","events_url":"https://api.github.com/users/nguyendthinh/events{/privacy}","received_events_url":"https://api.github.com/users/nguyendthinh/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-12-20T19:27:09Z","updated_at":"2016-12-20T19:28:55Z","closed_at":null,"body":"In the parent component, as I am passing the function as a prop to the child:\r\n\r\n```\r\n<Cell returnValues={this.returnValues.bind(this)} />\r\n```\r\n\r\nIn the child component, when I call for that prop function within another function:\r\n\r\n```\r\nuserClick(e) {\r\n.............\r\nthis.props.returnValues(currentColor, blocks) *the function takes two parameters*\r\n}\r\n```\r\nReact saids that it cannot read the property of bind (undefined) within the parents.\r\n\r\nI have also tried this variation in the parent and child\r\n\r\n```\r\n<Cell returnValues={(value1, value2) => this.returnValues(value1, value2)}\r\n```\r\n\r\n```\r\nuserClick(e) {\r\n...........\r\n      this.props.returnValues.bind(currentColor, blocks)\r\n}\r\n```\r\n\r\nthis variation does not give any error but it does not run the function either. Not sure of what to try?\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/ga-wdi-exercises/project4/issues/comments/268334867","html_url":"https://github.com/ga-wdi-exercises/project4/issues/414#issuecomment-268334867","issue_url":"https://api.github.com/repos/ga-wdi-exercises/project4/issues/414","id":268334867,"user":{"login":"superbuggy","id":17716232,"avatar_url":"https://avatars.githubusercontent.com/u/17716232?v=3","gravatar_id":"","url":"https://api.github.com/users/superbuggy","html_url":"https://github.com/superbuggy","followers_url":"https://api.github.com/users/superbuggy/followers","following_url":"https://api.github.com/users/superbuggy/following{/other_user}","gists_url":"https://api.github.com/users/superbuggy/gists{/gist_id}","starred_url":"https://api.github.com/users/superbuggy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/superbuggy/subscriptions","organizations_url":"https://api.github.com/users/superbuggy/orgs","repos_url":"https://api.github.com/users/superbuggy/repos","events_url":"https://api.github.com/users/superbuggy/events{/privacy}","received_events_url":"https://api.github.com/users/superbuggy/received_events","type":"User","site_admin":false},"created_at":"2016-12-20T19:28:55Z","updated_at":"2016-12-20T19:28:55Z","body":"do you have a function `returnValues(){` defined in the parent component (`GameBoard`, right?)?"}}
{"actor":{"display_login":"superbuggy"}}