{"action":"opened","issue":{"url":"https://api.github.com/repos/zeit/next.js/issues/4046","repository_url":"https://api.github.com/repos/zeit/next.js","labels_url":"https://api.github.com/repos/zeit/next.js/issues/4046/labels{/name}","comments_url":"https://api.github.com/repos/zeit/next.js/issues/4046/comments","events_url":"https://api.github.com/repos/zeit/next.js/issues/4046/events","html_url":"https://github.com/zeit/next.js/issues/4046","id":307887759,"number":4046,"title":"Can I add functions in the pages/document.js to handle click events?my code Like this,","user":{"login":"Hack-Jay","id":26273272,"avatar_url":"https://avatars2.githubusercontent.com/u/26273272?v=4","gravatar_id":"","url":"https://api.github.com/users/Hack-Jay","html_url":"https://github.com/Hack-Jay","followers_url":"https://api.github.com/users/Hack-Jay/followers","following_url":"https://api.github.com/users/Hack-Jay/following{/other_user}","gists_url":"https://api.github.com/users/Hack-Jay/gists{/gist_id}","starred_url":"https://api.github.com/users/Hack-Jay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Hack-Jay/subscriptions","organizations_url":"https://api.github.com/users/Hack-Jay/orgs","repos_url":"https://api.github.com/users/Hack-Jay/repos","events_url":"https://api.github.com/users/Hack-Jay/events{/privacy}","received_events_url":"https://api.github.com/users/Hack-Jay/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-23T03:13:52Z","updated_at":"2018-03-23T03:13:52Z","closed_at":null,"author_association":"NONE","body":"\r\n`\r\n    static async getInitialProps({ renderPage }) {\r\n      const { html, head, errorHtml, chunks } = renderPage()\r\n      let config = {\r\n        method: 'post',\r\n        data: {\r\n          query: `\r\n                query {\r\n                 ...\r\n                    }\r\n                }`\r\n        }\r\n      }\r\n      const res = await fetch(config)\r\n      const department = await Array.from(res.data.data.department)\r\n      const data = await resetDepartment(department, null, 0)\r\n      return { html, head, errorHtml, chunks , data  }\r\n    }\r\n`\r\n\r\n\r\n`  render() {\r\n      const data = this.props.data\r\n      if (data) {\r\n        return (\r\n          <html>\r\n            <Head>\r\n              <link rel=\"stylesheet\" href=\"/_next/static/style.css\" />\r\n              <link rel=\"stylesheet\" href=\"/static/header.css\" />\r\n            </Head>\r\n            <body>\r\n            {data.map( v =>{\r\n                 <li key={v.id} ><button onClick={ ??? }>{v.name}</button></li>\r\n            })}\r\n              <Main />\r\n              <NextScript />\r\n            </body>\r\n          </html>\r\n        )\r\n      }\r\n`\r\n\r\nHow do I add a click to button, I tried to add but didn't work?"}}
{"actor":{"display_login":"Hack-Jay"}}