{"action":"created","issue":{"url":"https://api.github.com/repos/clauderic/react-infinite-calendar/issues/92","repository_url":"https://api.github.com/repos/clauderic/react-infinite-calendar","labels_url":"https://api.github.com/repos/clauderic/react-infinite-calendar/issues/92/labels{/name}","comments_url":"https://api.github.com/repos/clauderic/react-infinite-calendar/issues/92/comments","events_url":"https://api.github.com/repos/clauderic/react-infinite-calendar/issues/92/events","html_url":"https://github.com/clauderic/react-infinite-calendar/issues/92","id":217148155,"number":92,"title":"Change parent's state to selected dates","user":{"login":"jiezhou0731","id":5614599,"avatar_url":"https://avatars2.githubusercontent.com/u/5614599?v=3","gravatar_id":"","url":"https://api.github.com/users/jiezhou0731","html_url":"https://github.com/jiezhou0731","followers_url":"https://api.github.com/users/jiezhou0731/followers","following_url":"https://api.github.com/users/jiezhou0731/following{/other_user}","gists_url":"https://api.github.com/users/jiezhou0731/gists{/gist_id}","starred_url":"https://api.github.com/users/jiezhou0731/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jiezhou0731/subscriptions","organizations_url":"https://api.github.com/users/jiezhou0731/orgs","repos_url":"https://api.github.com/users/jiezhou0731/repos","events_url":"https://api.github.com/users/jiezhou0731/events{/privacy}","received_events_url":"https://api.github.com/users/jiezhou0731/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-03-27T06:28:15Z","updated_at":"2017-03-27T13:57:41Z","closed_at":"2017-03-27T13:57:41Z","body":"```js\r\nrender() {\r\nreturn (\r\n  <InfiniteCalendar\r\n    Component={withMultipleDates(Calendar)}\r\n    selected={this.state.selectedDates}\r\n    interpolateSelection={defaultMultipleDateInterpolation}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    \r\n  />\r\n);\r\n}\r\n```\r\n\r\nIt doesn't change the parent's state."},"comment":{"url":"https://api.github.com/repos/clauderic/react-infinite-calendar/issues/comments/289461357","html_url":"https://github.com/clauderic/react-infinite-calendar/issues/92#issuecomment-289461357","issue_url":"https://api.github.com/repos/clauderic/react-infinite-calendar/issues/92","id":289461357,"user":{"login":"clauderic","id":1416436,"avatar_url":"https://avatars3.githubusercontent.com/u/1416436?v=3","gravatar_id":"","url":"https://api.github.com/users/clauderic","html_url":"https://github.com/clauderic","followers_url":"https://api.github.com/users/clauderic/followers","following_url":"https://api.github.com/users/clauderic/following{/other_user}","gists_url":"https://api.github.com/users/clauderic/gists{/gist_id}","starred_url":"https://api.github.com/users/clauderic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clauderic/subscriptions","organizations_url":"https://api.github.com/users/clauderic/orgs","repos_url":"https://api.github.com/users/clauderic/repos","events_url":"https://api.github.com/users/clauderic/events{/privacy}","received_events_url":"https://api.github.com/users/clauderic/received_events","type":"User","site_admin":false},"created_at":"2017-03-27T13:57:41Z","updated_at":"2017-03-27T13:57:41Z","body":"You need to pass an `onSelect` prop and mutate your state accordingly. `onSelect` returns the newly selected date, so it's up to you to decide how to handle that event. \r\n\r\nIf you want your state to live in your parent component though, you should probably use the controlled `Calendar` component instead though, to avoid duplication of state.\r\n\r\n```jsx\r\nimport {Calendar, defaultMultipleDateInterpolation} from 'react-infinite-calendar';\r\nconst MultipleDatesCalendar = withMultipleDates(Calendar);\r\n\r\nrender() {\r\n  return (\r\n    <MultipleDatesCalendar\r\n      selected={this.state.selectedDates}\r\n      onSelect={(selectedDate) => defaultMultipleDateInterpolation(selectedDate, this.state.selectedDates)}                                                                                                   \r\n    />\r\n  );\r\n}\r\n```\r\n\r\nCheck out the implementation of `defaultMultipleDateInterpolation` if you're curious about how it works: https://github.com/clauderic/react-infinite-calendar/blob/master/src/Calendar/withMultipleDates.js#L65"}}
{"actor":{"display_login":"clauderic"}}