{"action":"created","issue":{"url":"https://api.github.com/repos/vuejs/jsx/issues/7","repository_url":"https://api.github.com/repos/vuejs/jsx","labels_url":"https://api.github.com/repos/vuejs/jsx/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/vuejs/jsx/issues/7/comments","events_url":"https://api.github.com/repos/vuejs/jsx/issues/7/events","html_url":"https://github.com/vuejs/jsx/issues/7","id":351827314,"node_id":"MDU6SXNzdWUzNTE4MjczMTQ=","number":7,"title":"Data spread operation mutates given object","user":{"login":"Aaron-Pool","id":5634834,"node_id":"MDQ6VXNlcjU2MzQ4MzQ=","avatar_url":"https://avatars0.githubusercontent.com/u/5634834?v=4","gravatar_id":"","url":"https://api.github.com/users/Aaron-Pool","html_url":"https://github.com/Aaron-Pool","followers_url":"https://api.github.com/users/Aaron-Pool/followers","following_url":"https://api.github.com/users/Aaron-Pool/following{/other_user}","gists_url":"https://api.github.com/users/Aaron-Pool/gists{/gist_id}","starred_url":"https://api.github.com/users/Aaron-Pool/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Aaron-Pool/subscriptions","organizations_url":"https://api.github.com/users/Aaron-Pool/orgs","repos_url":"https://api.github.com/users/Aaron-Pool/repos","events_url":"https://api.github.com/users/Aaron-Pool/events{/privacy}","received_events_url":"https://api.github.com/users/Aaron-Pool/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-08-18T15:07:58Z","updated_at":"2018-08-20T20:51:05Z","closed_at":null,"author_association":"NONE","body":"Hey, I'm leaving this issue here, as well as https://github.com/vuejs/babel-helper-vue-jsx-merge-props/issues/10, because I'm not sure which repository is where bugs will be handled going forward.\r\n\r\nI suppose this could be _intended_ behavior, but if it is, I'd kinda wanna know why.\r\n\r\nI was writing some stories for my vue storybook and ran into an instance where I was iterating over different variations of a component like so:\r\n\r\n```js\r\nrender() {\r\n    types = [...blah];\r\n    types.map(t => {\r\n        const data = { attrs: { types[t]: true } };\r\n        <ProfilePic {...data} />\r\n        <ProfilePic url={picUrl} {...data} />\r\n    }\r\n}\r\n```\r\n\r\nI was getting odd behavior on the second component, and I managed to track it down to the fact that the `data` object is actually mutated in the creation of the first element. All the props are removed from the `data` object when props are \"extracted\" and applied to the element.\r\n\r\nIs this intended behavior? or a bug? It seems like the data object to be merged should be cloned instead of mutated, but let me know if there's a reason for this. I can create a repro code pen if needed."},"comment":{"url":"https://api.github.com/repos/vuejs/jsx/issues/comments/414458806","html_url":"https://github.com/vuejs/jsx/issues/7#issuecomment-414458806","issue_url":"https://api.github.com/repos/vuejs/jsx/issues/7","id":414458806,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNDQ1ODgwNg==","user":{"login":"Aaron-Pool","id":5634834,"node_id":"MDQ6VXNlcjU2MzQ4MzQ=","avatar_url":"https://avatars0.githubusercontent.com/u/5634834?v=4","gravatar_id":"","url":"https://api.github.com/users/Aaron-Pool","html_url":"https://github.com/Aaron-Pool","followers_url":"https://api.github.com/users/Aaron-Pool/followers","following_url":"https://api.github.com/users/Aaron-Pool/following{/other_user}","gists_url":"https://api.github.com/users/Aaron-Pool/gists{/gist_id}","starred_url":"https://api.github.com/users/Aaron-Pool/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Aaron-Pool/subscriptions","organizations_url":"https://api.github.com/users/Aaron-Pool/orgs","repos_url":"https://api.github.com/users/Aaron-Pool/repos","events_url":"https://api.github.com/users/Aaron-Pool/events{/privacy}","received_events_url":"https://api.github.com/users/Aaron-Pool/received_events","type":"User","site_admin":false},"created_at":"2018-08-20T20:51:05Z","updated_at":"2018-08-20T20:51:05Z","author_association":"NONE","body":"Ok! Here you are: https://codepan.net/gist/8336b69647780baba348ca380c83be59\r\n\r\nAs you can see, if two elements share a data object, the first jsx element seems to _remove_ the prop field from the data object when it uses it."}}
{"actor":{"display_login":"Aaron-Pool"}}