{"action":"created","issue":{"url":"https://api.github.com/repos/kriasoft/react-starter-kit/issues/158","repository_url":"https://api.github.com/repos/kriasoft/react-starter-kit","labels_url":"https://api.github.com/repos/kriasoft/react-starter-kit/issues/158/labels{/name}","comments_url":"https://api.github.com/repos/kriasoft/react-starter-kit/issues/158/comments","events_url":"https://api.github.com/repos/kriasoft/react-starter-kit/issues/158/events","html_url":"https://github.com/kriasoft/react-starter-kit/issues/158","id":91943270,"number":158,"title":"why onClick={anyfunction} is not working, include original code \" <a className=\"Footer-link\" href=\"/\" onClick={Link.handleClick}>License</a> \",when click the link, handleClick won't be called. what's wrong? thanks.","user":{"login":"zhangtiny123","id":8130800,"avatar_url":"https://avatars.githubusercontent.com/u/8130800?v=3","gravatar_id":"","url":"https://api.github.com/users/zhangtiny123","html_url":"https://github.com/zhangtiny123","followers_url":"https://api.github.com/users/zhangtiny123/followers","following_url":"https://api.github.com/users/zhangtiny123/following{/other_user}","gists_url":"https://api.github.com/users/zhangtiny123/gists{/gist_id}","starred_url":"https://api.github.com/users/zhangtiny123/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zhangtiny123/subscriptions","organizations_url":"https://api.github.com/users/zhangtiny123/orgs","repos_url":"https://api.github.com/users/zhangtiny123/repos","events_url":"https://api.github.com/users/zhangtiny123/events{/privacy}","received_events_url":"https://api.github.com/users/zhangtiny123/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2015-06-30T00:38:12Z","updated_at":"2016-10-13T09:56:27Z","closed_at":null,"body":"\r\n\r\n<bountysource-plugin>\r\n---\r\nWant to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/23340959-why-onclick-anyfunction-is-not-working-include-original-code-a-classname-footer-link-href-onclick-link-handleclick-license-a-when-click-the-link-handleclick-won-t-be-called-what-s-wrong-thanks?utm_campaign=plugin&utm_content=tracker%2F1144755&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F1144755&utm_medium=issues&utm_source=github).\r\n</bountysource-plugin>"},"comment":{"url":"https://api.github.com/repos/kriasoft/react-starter-kit/issues/comments/253469086","html_url":"https://github.com/kriasoft/react-starter-kit/issues/158#issuecomment-253469086","issue_url":"https://api.github.com/repos/kriasoft/react-starter-kit/issues/158","id":253469086,"user":{"login":"koistya","id":197134,"avatar_url":"https://avatars.githubusercontent.com/u/197134?v=3","gravatar_id":"","url":"https://api.github.com/users/koistya","html_url":"https://github.com/koistya","followers_url":"https://api.github.com/users/koistya/followers","following_url":"https://api.github.com/users/koistya/following{/other_user}","gists_url":"https://api.github.com/users/koistya/gists{/gist_id}","starred_url":"https://api.github.com/users/koistya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/koistya/subscriptions","organizations_url":"https://api.github.com/users/koistya/orgs","repos_url":"https://api.github.com/users/koistya/repos","events_url":"https://api.github.com/users/koistya/events{/privacy}","received_events_url":"https://api.github.com/users/koistya/received_events","type":"User","site_admin":false},"created_at":"2016-10-13T09:56:27Z","updated_at":"2016-10-13T09:56:27Z","body":"@zhangtiny123, @sethmcleod if you don't want to use Link component, you can handle onClick event manually, something like this:\r\n\r\n```js\r\nimport React from 'react';\r\nimport history from '../core/history';\r\n\r\nfunction handleClick(event) {\r\n  event.preventDefault();\r\n  history.push(event.target.getAttribute('href'));\r\n}\r\n\r\nfunction MyComponent() {\r\n  return (\r\n    <div>\r\n      <a href=\"/path\" onClick={handleClick}>Click me</a>\r\n    </div>\r\n  );\r\n}\r\n\r\nexport default MyComponent;\r\n```"}}
{"actor":{"display_login":"koistya"}}