{"action":"created","issue":{"url":"https://api.github.com/repos/mdx-js/mdx/issues/139","repository_url":"https://api.github.com/repos/mdx-js/mdx","labels_url":"https://api.github.com/repos/mdx-js/mdx/issues/139/labels{/name}","comments_url":"https://api.github.com/repos/mdx-js/mdx/issues/139/comments","events_url":"https://api.github.com/repos/mdx-js/mdx/issues/139/events","html_url":"https://github.com/mdx-js/mdx/issues/139","id":321206298,"number":139,"title":"Bug: working with render props","user":{"login":"pedronauck","id":2029172,"avatar_url":"https://avatars3.githubusercontent.com/u/2029172?v=4","gravatar_id":"","url":"https://api.github.com/users/pedronauck","html_url":"https://github.com/pedronauck","followers_url":"https://api.github.com/users/pedronauck/followers","following_url":"https://api.github.com/users/pedronauck/following{/other_user}","gists_url":"https://api.github.com/users/pedronauck/gists{/gist_id}","starred_url":"https://api.github.com/users/pedronauck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pedronauck/subscriptions","organizations_url":"https://api.github.com/users/pedronauck/orgs","repos_url":"https://api.github.com/users/pedronauck/repos","events_url":"https://api.github.com/users/pedronauck/events{/privacy}","received_events_url":"https://api.github.com/users/pedronauck/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-05-08T14:17:58Z","updated_at":"2018-05-08T19:57:05Z","closed_at":"2018-05-08T19:57:05Z","author_association":"NONE","body":"Isn't possible to reproduce render props component like that:\r\n\r\n```\r\nimport { Foo } from './Foo'\r\n\r\n# Hello Foo\r\n\r\n<Foo>\r\n  {() => {\r\n    const bar = 'bar'\r\n\r\n    return (\r\n      <Bar bar={bar} />\r\n    )\r\n  }}\r\n</Foo>\r\n```\r\n\r\nI noticed that in the `MDAST => MDXAST` process you just turn `HTML` into `JSX` nodes, but in this case the line breaks between `const` and `return` is a trade off, because the parse is a `Paragraph` instead of the same scope of `HTML`.\r\n\r\nSo, I was trying to figure out how fix this and I think that what can be a possible solution is create something like a merge between nodes when the `HTML` node that has the opening tag is invalid (without enclosing tag). I don't know if this can generate some trade offs or is a solution that fit in all cases. So, I didn't think yet how this can affect performance, but was the only thing that came in mind in that case 😞 "},"comment":{"url":"https://api.github.com/repos/mdx-js/mdx/issues/comments/387523342","html_url":"https://github.com/mdx-js/mdx/issues/139#issuecomment-387523342","issue_url":"https://api.github.com/repos/mdx-js/mdx/issues/139","id":387523342,"user":{"login":"timneutkens","id":6324199,"avatar_url":"https://avatars2.githubusercontent.com/u/6324199?v=4","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":"2018-05-08T19:57:05Z","updated_at":"2018-05-08T19:57:05Z","author_association":"COLLABORATOR","body":"So the only reason Pedro’s example doesn’t work is the empty line break between const and return, remark Will parse that as 2 paragraph nodes"}}
{"actor":{"display_login":"timneutkens"}}