{"action":"created","issue":{"url":"https://api.github.com/repos/reactjs/react-codemod/issues/12","labels_url":"https://api.github.com/repos/reactjs/react-codemod/issues/12/labels{/name}","comments_url":"https://api.github.com/repos/reactjs/react-codemod/issues/12/comments","events_url":"https://api.github.com/repos/reactjs/react-codemod/issues/12/events","html_url":"https://github.com/reactjs/react-codemod/pull/12","id":115762045,"number":12,"title":"create-element-to-jsx-children: Convert mixed strings to JSXText instead of Literal","user":{"login":"TheSavior","id":249164,"avatar_url":"https://avatars.githubusercontent.com/u/249164?v=3","gravatar_id":"","url":"https://api.github.com/users/TheSavior","html_url":"https://github.com/TheSavior","followers_url":"https://api.github.com/users/TheSavior/followers","following_url":"https://api.github.com/users/TheSavior/following{/other_user}","gists_url":"https://api.github.com/users/TheSavior/gists{/gist_id}","starred_url":"https://api.github.com/users/TheSavior/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TheSavior/subscriptions","organizations_url":"https://api.github.com/users/TheSavior/orgs","repos_url":"https://api.github.com/users/TheSavior/repos","events_url":"https://api.github.com/users/TheSavior/events{/privacy}","received_events_url":"https://api.github.com/users/TheSavior/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/reactjs/react-codemod/labels/CLA%20Signed","name":"CLA Signed","color":"009900"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-11-08T21:19:35Z","updated_at":"2015-11-09T19:25:05Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/reactjs/react-codemod/pulls/12","html_url":"https://github.com/reactjs/react-codemod/pull/12","diff_url":"https://github.com/reactjs/react-codemod/pull/12.diff","patch_url":"https://github.com/reactjs/react-codemod/pull/12.patch"},"body":"Based on #10 \r\n\r\nThis\r\n\r\n```\r\nReact.createElement(\r\n  'div',\r\n  null,\r\n  a,\r\n  ' ',\r\n  a\r\n);\r\n```\r\n\r\nwas getting transformed to\r\n\r\n```\r\n<div>{a}\" \"{a}</div>;\r\n```\r\n\r\nNow there are no unnecessary quotes.\r\n\r\nHowever, I'm having a problem.\r\nThis\r\n```\r\nReact.createElement(\r\n  'div',\r\n  null,\r\n  ' lala '\r\n);\r\n```\r\nis being converted to\r\n```\r\n<div>lala</div>;\r\n```\r\n\r\nLosing the padding spaces. It seems like `j.jsxText('  foo  ');` gets output as `foo`. `literal` has the same issue. So how can I make that case work?"},"comment":{"url":"https://api.github.com/repos/reactjs/react-codemod/issues/comments/155164963","html_url":"https://github.com/reactjs/react-codemod/pull/12#issuecomment-155164963","issue_url":"https://api.github.com/repos/reactjs/react-codemod/issues/12","id":155164963,"user":{"login":"cpojer","id":13352,"avatar_url":"https://avatars.githubusercontent.com/u/13352?v=3","gravatar_id":"","url":"https://api.github.com/users/cpojer","html_url":"https://github.com/cpojer","followers_url":"https://api.github.com/users/cpojer/followers","following_url":"https://api.github.com/users/cpojer/following{/other_user}","gists_url":"https://api.github.com/users/cpojer/gists{/gist_id}","starred_url":"https://api.github.com/users/cpojer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cpojer/subscriptions","organizations_url":"https://api.github.com/users/cpojer/orgs","repos_url":"https://api.github.com/users/cpojer/repos","events_url":"https://api.github.com/users/cpojer/events{/privacy}","received_events_url":"https://api.github.com/users/cpojer/received_events","type":"User","site_admin":false},"created_at":"2015-11-09T19:25:05Z","updated_at":"2015-11-09T19:25:05Z","body":"Oh, sorry, I thought fixing the first thing would break the second and vice-versa. So you are saying that `j.jsxText(' foo ')` always prints as `foo` instead of ` foo `."}}