{"action":"created","issue":{"url":"https://api.github.com/repos/leandrowd/react-responsive-carousel/issues/30","repository_url":"https://api.github.com/repos/leandrowd/react-responsive-carousel","labels_url":"https://api.github.com/repos/leandrowd/react-responsive-carousel/issues/30/labels{/name}","comments_url":"https://api.github.com/repos/leandrowd/react-responsive-carousel/issues/30/comments","events_url":"https://api.github.com/repos/leandrowd/react-responsive-carousel/issues/30/events","html_url":"https://github.com/leandrowd/react-responsive-carousel/issues/30","id":139343541,"number":30,"title":"setState Can only update a mounted or mounting component","user":{"login":"QuietOmen","id":9030892,"avatar_url":"https://avatars.githubusercontent.com/u/9030892?v=3","gravatar_id":"","url":"https://api.github.com/users/QuietOmen","html_url":"https://github.com/QuietOmen","followers_url":"https://api.github.com/users/QuietOmen/followers","following_url":"https://api.github.com/users/QuietOmen/following{/other_user}","gists_url":"https://api.github.com/users/QuietOmen/gists{/gist_id}","starred_url":"https://api.github.com/users/QuietOmen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/QuietOmen/subscriptions","organizations_url":"https://api.github.com/users/QuietOmen/orgs","repos_url":"https://api.github.com/users/QuietOmen/repos","events_url":"https://api.github.com/users/QuietOmen/events{/privacy}","received_events_url":"https://api.github.com/users/QuietOmen/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/leandrowd/react-responsive-carousel/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-03-08T17:39:40Z","updated_at":"2016-09-10T10:55:57Z","closed_at":"2016-09-10T10:55:57Z","body":"I get the following errors: \r\n\r\n```\r\nWarning: setState(...): Can only update a mounted or mounting component. This usually means you called setState() on an unmounted component. This is a no-op. Please check the code for the Slider component.\r\n\r\nUncaught TypeError: Cannot read property 'clientWidth' of null\r\n```\r\nIt seems to stem back to the following function inside of Carousel.js\r\n\r\n```\r\nsetMountState () {\r\n     this.setState({hasMount: true});\r\n     this.updateSizes();\r\n     this.forceUpdate();\r\n},\r\n```\r\n\r\nThe clientWidth of null comes from the updateSizes function being called. I don't believe we are incorrectly using the library. Here's where we use the carousel component: \r\n\r\n\r\n```\r\nimport React, {PropTypes} from 'react';\r\nimport {Carousel} from 'react-responsive-carousel';\r\nimport './styles';\r\n\r\nexport function CarouselComponent({data}) {\r\n  if (!data || data['total-images'] === 0) {\r\n    return <span />;\r\n  }\r\n  return (\r\n    <div className=\"carousel-component\">\r\n      <Carousel\r\n        showThumbs={data.gallery.length > 1}\r\n        showArrows={true}\r\n        showStatus={false}\r\n        showIndicators={false}\r\n      >\r\n        {\r\n          data.gallery.map(\r\n            (item, index) => <img src={item['image-url']} key={index} />\r\n          )\r\n        }\r\n      </Carousel>\r\n      <div className=\"photo-count\">\r\n        <span className=\"swipe-to-see\">\r\n          Swipe to see&nbsp;\r\n        </span>\r\n        {data['total-images']} photos\r\n      </div>\r\n    </div>\r\n  );\r\n}\r\n\r\nCarouselComponent.propTypes = {\r\n  data: PropTypes.any,\r\n};\r\n```\r\n\r\nAlso we're on react-responsive-carousel 3.0.9."},"comment":{"url":"https://api.github.com/repos/leandrowd/react-responsive-carousel/issues/comments/246105506","html_url":"https://github.com/leandrowd/react-responsive-carousel/issues/30#issuecomment-246105506","issue_url":"https://api.github.com/repos/leandrowd/react-responsive-carousel/issues/30","id":246105506,"user":{"login":"leandrowd","id":165005,"avatar_url":"https://avatars.githubusercontent.com/u/165005?v=3","gravatar_id":"","url":"https://api.github.com/users/leandrowd","html_url":"https://github.com/leandrowd","followers_url":"https://api.github.com/users/leandrowd/followers","following_url":"https://api.github.com/users/leandrowd/following{/other_user}","gists_url":"https://api.github.com/users/leandrowd/gists{/gist_id}","starred_url":"https://api.github.com/users/leandrowd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leandrowd/subscriptions","organizations_url":"https://api.github.com/users/leandrowd/orgs","repos_url":"https://api.github.com/users/leandrowd/repos","events_url":"https://api.github.com/users/leandrowd/events{/privacy}","received_events_url":"https://api.github.com/users/leandrowd/received_events","type":"User","site_admin":false},"created_at":"2016-09-10T10:55:57Z","updated_at":"2016-09-10T10:55:57Z","body":"This issue was fixed and released as 3.0.16"}}
{"actor":{"display_login":"leandrowd"}}