{"action":"created","issue":{"url":"https://api.github.com/repos/zeit/next.js/issues/1118","repository_url":"https://api.github.com/repos/zeit/next.js","labels_url":"https://api.github.com/repos/zeit/next.js/issues/1118/labels{/name}","comments_url":"https://api.github.com/repos/zeit/next.js/issues/1118/comments","events_url":"https://api.github.com/repos/zeit/next.js/issues/1118/events","html_url":"https://github.com/zeit/next.js/issues/1118","id":207363406,"number":1118,"title":"Compose link href from \"to\" property object with href, query and hash","user":{"login":"marcelmokos","id":6388074,"avatar_url":"https://avatars.githubusercontent.com/u/6388074?v=3","gravatar_id":"","url":"https://api.github.com/users/marcelmokos","html_url":"https://github.com/marcelmokos","followers_url":"https://api.github.com/users/marcelmokos/followers","following_url":"https://api.github.com/users/marcelmokos/following{/other_user}","gists_url":"https://api.github.com/users/marcelmokos/gists{/gist_id}","starred_url":"https://api.github.com/users/marcelmokos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcelmokos/subscriptions","organizations_url":"https://api.github.com/users/marcelmokos/orgs","repos_url":"https://api.github.com/users/marcelmokos/repos","events_url":"https://api.github.com/users/marcelmokos/events{/privacy}","received_events_url":"https://api.github.com/users/marcelmokos/received_events","type":"User","site_admin":false},"labels":[{"id":455907200,"url":"https://api.github.com/repos/zeit/next.js/labels/Type:%20Question","name":"Type: Question","color":"cc317c","default":false}],"state":"open","locked":false,"assignee":{"login":"timneutkens","id":6324199,"avatar_url":"https://avatars.githubusercontent.com/u/6324199?v=3","gravatar_id":"","url":"https://api.github.com/users/timneutkens","html_url":"https://github.com/timneutkens","followers_url":"https://api.github.com/users/timneutkens/followers","following_url":"https://api.github.com/users/timneutkens/following{/other_user}","gists_url":"https://api.github.com/users/timneutkens/gists{/gist_id}","starred_url":"https://api.github.com/users/timneutkens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timneutkens/subscriptions","organizations_url":"https://api.github.com/users/timneutkens/orgs","repos_url":"https://api.github.com/users/timneutkens/repos","events_url":"https://api.github.com/users/timneutkens/events{/privacy}","received_events_url":"https://api.github.com/users/timneutkens/received_events","type":"User","site_admin":false},"assignees":[{"login":"timneutkens","id":6324199,"avatar_url":"https://avatars.githubusercontent.com/u/6324199?v=3","gravatar_id":"","url":"https://api.github.com/users/timneutkens","html_url":"https://github.com/timneutkens","followers_url":"https://api.github.com/users/timneutkens/followers","following_url":"https://api.github.com/users/timneutkens/following{/other_user}","gists_url":"https://api.github.com/users/timneutkens/gists{/gist_id}","starred_url":"https://api.github.com/users/timneutkens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timneutkens/subscriptions","organizations_url":"https://api.github.com/users/timneutkens/orgs","repos_url":"https://api.github.com/users/timneutkens/repos","events_url":"https://api.github.com/users/timneutkens/events{/privacy}","received_events_url":"https://api.github.com/users/timneutkens/received_events","type":"User","site_admin":false}],"milestone":null,"comments":0,"created_at":"2017-02-13T22:49:49Z","updated_at":"2017-02-13T23:23:39Z","closed_at":null,"body":"Link element in ReactRouter comes with \"to\" property which can have href, query object and hash inside.\r\n\r\nI prefer to build a query from an object instead of using string templates.\r\n\r\n```javascript\r\n// desired api\r\n// <Link to={{href?: string, query?: object, hash?: string}}>\r\n\r\n// desired input\r\n<Link to={{href: \"home\", query: {key: \"value\"}, hash: \"hash\"}}><a>text</a></Link> \r\n\r\n// desired output \r\n<a href=\"/home?key=value#hash\">text</a>\r\n```\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/zeit/next.js/issues/comments/279556698","html_url":"https://github.com/zeit/next.js/issues/1118#issuecomment-279556698","issue_url":"https://api.github.com/repos/zeit/next.js/issues/1118","id":279556698,"user":{"login":"timneutkens","id":6324199,"avatar_url":"https://avatars.githubusercontent.com/u/6324199?v=3","gravatar_id":"","url":"https://api.github.com/users/timneutkens","html_url":"https://github.com/timneutkens","followers_url":"https://api.github.com/users/timneutkens/followers","following_url":"https://api.github.com/users/timneutkens/following{/other_user}","gists_url":"https://api.github.com/users/timneutkens/gists{/gist_id}","starred_url":"https://api.github.com/users/timneutkens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timneutkens/subscriptions","organizations_url":"https://api.github.com/users/timneutkens/orgs","repos_url":"https://api.github.com/users/timneutkens/repos","events_url":"https://api.github.com/users/timneutkens/events{/privacy}","received_events_url":"https://api.github.com/users/timneutkens/received_events","type":"User","site_admin":false},"created_at":"2017-02-13T23:23:39Z","updated_at":"2017-02-13T23:23:39Z","body":"1. Install `url` (`npm install url --save`)\r\n2. Create a new file\r\n3. Add the following code\r\n\r\n```js\r\nimport Link from 'next/link'\r\nimport url from 'url'\r\nexport default ({ to, children }) => {\r\n  return <Link href={url.format(to)}>{children}</Link>\r\n}\r\n```\r\n\r\n```js\r\n// Import your component instead of next/link\r\n<Link to={{pathname: \"home\", query: {key: \"value\"}, hash: \"hash\"}}><a>example</a></Link>\r\n```\r\n\r\nTo has to be formatted regarding:\r\nhttps://www.npmjs.com/package/url#urlformaturlobj"}}
{"actor":{"display_login":"timneutkens"}}