{"action":"created","issue":{"url":"https://api.github.com/repos/IBM/carbon-components-react/issues/1255","repository_url":"https://api.github.com/repos/IBM/carbon-components-react","labels_url":"https://api.github.com/repos/IBM/carbon-components-react/issues/1255/labels{/name}","comments_url":"https://api.github.com/repos/IBM/carbon-components-react/issues/1255/comments","events_url":"https://api.github.com/repos/IBM/carbon-components-react/issues/1255/events","html_url":"https://github.com/IBM/carbon-components-react/pull/1255","id":355419838,"node_id":"MDExOlB1bGxSZXF1ZXN0MjExOTUyMjU1","number":1255,"title":"fix(components): Fix state warning errors","user":{"login":"zerostatic","id":209432,"node_id":"MDQ6VXNlcjIwOTQzMg==","avatar_url":"https://avatars0.githubusercontent.com/u/209432?v=4","gravatar_id":"","url":"https://api.github.com/users/zerostatic","html_url":"https://github.com/zerostatic","followers_url":"https://api.github.com/users/zerostatic/followers","following_url":"https://api.github.com/users/zerostatic/following{/other_user}","gists_url":"https://api.github.com/users/zerostatic/gists{/gist_id}","starred_url":"https://api.github.com/users/zerostatic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zerostatic/subscriptions","organizations_url":"https://api.github.com/users/zerostatic/orgs","repos_url":"https://api.github.com/users/zerostatic/repos","events_url":"https://api.github.com/users/zerostatic/events{/privacy}","received_events_url":"https://api.github.com/users/zerostatic/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2018-08-30T04:27:44Z","updated_at":"2018-09-04T22:07:57Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/IBM/carbon-components-react/pulls/1255","html_url":"https://github.com/IBM/carbon-components-react/pull/1255","diff_url":"https://github.com/IBM/carbon-components-react/pull/1255.diff","patch_url":"https://github.com/IBM/carbon-components-react/pull/1255.patch"},"body":"Closes #1243\r\n\r\nA few components are giving the following error in the console:\r\n```\r\nDid not properly initialize state during construction. \r\nExpected state to be an object, but it was undefined.\r\n```\r\n\r\n#### Changelog\r\n\r\nThe following components were fixed:\r\nAccordionItem\r\nComposedModal\r\nContentSwitcher\r\nFileUploader\r\nNumberInput\r\nOverflowMenu\r\nPaginationV2\r\nProgressIndicator\r\nRadioButtonGroup\r\nSearchLayoutButton\r\nTimePicker.js\r\nTooltip.js\r\n\r\n#### Notes\r\n\r\nA few components were checking is the state variable was defined. I had to change this now to check if state is an empty object. This is the instances were you see this: \r\n```\r\nlet emptyState =\r\n      Object.keys(state).length === 0 && state.constructor === Object;\r\n```\r\n\r\n![giphy](https://media.giphy.com/media/pkqqFEa3Gqjfy/giphy.gif)"},"comment":{"url":"https://api.github.com/repos/IBM/carbon-components-react/issues/comments/418533843","html_url":"https://github.com/IBM/carbon-components-react/pull/1255#issuecomment-418533843","issue_url":"https://api.github.com/repos/IBM/carbon-components-react/issues/1255","id":418533843,"node_id":"MDEyOklzc3VlQ29tbWVudDQxODUzMzg0Mw==","user":{"login":"asudoh","id":1259051,"node_id":"MDQ6VXNlcjEyNTkwNTE=","avatar_url":"https://avatars1.githubusercontent.com/u/1259051?v=4","gravatar_id":"","url":"https://api.github.com/users/asudoh","html_url":"https://github.com/asudoh","followers_url":"https://api.github.com/users/asudoh/followers","following_url":"https://api.github.com/users/asudoh/following{/other_user}","gists_url":"https://api.github.com/users/asudoh/gists{/gist_id}","starred_url":"https://api.github.com/users/asudoh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asudoh/subscriptions","organizations_url":"https://api.github.com/users/asudoh/orgs","repos_url":"https://api.github.com/users/asudoh/repos","events_url":"https://api.github.com/users/asudoh/events{/privacy}","received_events_url":"https://api.github.com/users/asudoh/received_events","type":"User","site_admin":false},"created_at":"2018-09-04T22:07:57Z","updated_at":"2018-09-04T22:07:57Z","author_association":"MEMBER","body":"Thanks @zerostatic for your updates! Would you want to make similar changes to `gDSFP()` in files where you added empty initial states? If you don’t feel like it it’ll be no problem - Let us know. Thanks!"}}
{"actor":{"display_login":"asudoh"}}