{"action":"created","issue":{"url":"https://api.github.com/repos/IBM/carbon-components-react/issues/1064","repository_url":"https://api.github.com/repos/IBM/carbon-components-react","labels_url":"https://api.github.com/repos/IBM/carbon-components-react/issues/1064/labels{/name}","comments_url":"https://api.github.com/repos/IBM/carbon-components-react/issues/1064/comments","events_url":"https://api.github.com/repos/IBM/carbon-components-react/issues/1064/events","html_url":"https://github.com/IBM/carbon-components-react/issues/1064","id":339894057,"node_id":"MDU6SXNzdWUzMzk4OTQwNTc=","number":1064,"title":"Unable to use Redux state to toggle the AccordionItem ","user":{"login":"dejunqi2008","id":12088027,"node_id":"MDQ6VXNlcjEyMDg4MDI3","avatar_url":"https://avatars0.githubusercontent.com/u/12088027?v=4","gravatar_id":"","url":"https://api.github.com/users/dejunqi2008","html_url":"https://github.com/dejunqi2008","followers_url":"https://api.github.com/users/dejunqi2008/followers","following_url":"https://api.github.com/users/dejunqi2008/following{/other_user}","gists_url":"https://api.github.com/users/dejunqi2008/gists{/gist_id}","starred_url":"https://api.github.com/users/dejunqi2008/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dejunqi2008/subscriptions","organizations_url":"https://api.github.com/users/dejunqi2008/orgs","repos_url":"https://api.github.com/users/dejunqi2008/repos","events_url":"https://api.github.com/users/dejunqi2008/events{/privacy}","received_events_url":"https://api.github.com/users/dejunqi2008/received_events","type":"User","site_admin":false},"labels":[{"id":717047679,"node_id":"MDU6TGFiZWw3MTcwNDc2Nzk=","url":"https://api.github.com/repos/IBM/carbon-components-react/labels/good%20first%20issue%20%F0%9F%91%8B","name":"good first issue 👋","color":"7057ff","default":false},{"id":613854896,"node_id":"MDU6TGFiZWw2MTM4NTQ4OTY=","url":"https://api.github.com/repos/IBM/carbon-components-react/labels/status:%20help%20wanted%20:open_hands:","name":"status: help wanted :open_hands:","color":"7057ff","default":false},{"id":613854895,"node_id":"MDU6TGFiZWw2MTM4NTQ4OTU=","url":"https://api.github.com/repos/IBM/carbon-components-react/labels/type:%20enhancement%20%F0%9F%92%A1","name":"type: enhancement 💡","color":"84b6eb","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-07-10T15:27:42Z","updated_at":"2018-09-06T15:51:07Z","closed_at":"2018-09-06T15:51:07Z","author_association":"NONE","body":"<!-- Feel free to remove sections that aren't relevant.\r\n\r\n## Title line template: [Title]: Brief description\r\nUnable to use Redux state to toggle the AccordionItem\r\n-->\r\n\r\n## Detailed description\r\n\r\n> Describe in detail the issue you're having.\r\n\r\nAs for the <AccordionItem> component, we want to use Redux state to control the expand and collapse of it. But it looks like once the <AccordionItem ... /> is it mounted, it is impossible to flip it on and off until we click it.\r\n\r\nI looked at the code of AccordionItem component. Not exactly sure, but I am guessing that the following code gives us some trouble:\r\n```\r\n  UNSAFE_componentWillReceiveProps({ open }) {\r\n    if (open !== this.props.open) {\r\n      this.setState({ open });\r\n    }\r\n  }\r\n```\r\nLooked at some articles, looks like the `UNSAFE_componentWillReceiveProps` method will not work if we want to update the state asynchronously. Should you use the `componentWillUpdate` or `componentDidUpdate` instead ?\r\n\r\n> Is this a feature request (new component, new icon), a bug, or a general issue?\r\n\r\n> Is this issue related to a specific component?\r\n\r\n> What did you expect to happen? What happened instead? What would you like to see changed?\r\n\r\n> What browser are you working in?\r\n\r\n> What version of the Carbon Design System are you using?\r\n\r\n> What offering/product do you work on? Any pressing ship or release dates we should be aware of?\r\n\r\n## Steps to reproduce the issue\r\n\r\n<!--\r\nPlease try to re-create the issue using our Codesandbox template available here:\r\nhttps://codesandbox.io/s/x2mjypo6pp\r\n\r\nThis helps reduce the issue to an isolated case that helps us out when debugging.\r\nIf you're able to reproduce using the codesandbox link above, please include the\r\nlink in addition to the steps to reproduce. Thanks so much!\r\n-->\r\n\r\n<!-- [Codesandbox](<url>) -->\r\n\r\n1. Step one\r\n2. Step two\r\n3. Step three\r\n4. etc.\r\n\r\n## Additional information\r\n\r\n* Screenshots or code\r\n* Notes\r\n"},"comment":{"url":"https://api.github.com/repos/IBM/carbon-components-react/issues/comments/419145790","html_url":"https://github.com/IBM/carbon-components-react/issues/1064#issuecomment-419145790","issue_url":"https://api.github.com/repos/IBM/carbon-components-react/issues/1064","id":419145790,"node_id":"MDEyOklzc3VlQ29tbWVudDQxOTE0NTc5MA==","user":{"login":"tw15egan","id":11928039,"node_id":"MDQ6VXNlcjExOTI4MDM5","avatar_url":"https://avatars1.githubusercontent.com/u/11928039?v=4","gravatar_id":"","url":"https://api.github.com/users/tw15egan","html_url":"https://github.com/tw15egan","followers_url":"https://api.github.com/users/tw15egan/followers","following_url":"https://api.github.com/users/tw15egan/following{/other_user}","gists_url":"https://api.github.com/users/tw15egan/gists{/gist_id}","starred_url":"https://api.github.com/users/tw15egan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tw15egan/subscriptions","organizations_url":"https://api.github.com/users/tw15egan/orgs","repos_url":"https://api.github.com/users/tw15egan/repos","events_url":"https://api.github.com/users/tw15egan/events{/privacy}","received_events_url":"https://api.github.com/users/tw15egan/received_events","type":"User","site_admin":false},"created_at":"2018-09-06T15:51:07Z","updated_at":"2018-09-06T15:51:07Z","author_association":"MEMBER","body":"Closing due to inactivity "}}
{"actor":{"display_login":"tw15egan"}}