{"action":"created","issue":{"url":"https://api.github.com/repos/intljusticemission/react-big-calendar/issues/1080","repository_url":"https://api.github.com/repos/intljusticemission/react-big-calendar","labels_url":"https://api.github.com/repos/intljusticemission/react-big-calendar/issues/1080/labels{/name}","comments_url":"https://api.github.com/repos/intljusticemission/react-big-calendar/issues/1080/comments","events_url":"https://api.github.com/repos/intljusticemission/react-big-calendar/issues/1080/events","html_url":"https://github.com/intljusticemission/react-big-calendar/issues/1080","id":376770470,"node_id":"MDU6SXNzdWUzNzY3NzA0NzA=","number":1080,"title":"Component crashes if \"month\" view were omitted ","user":{"login":"RusinovAnton","id":13165540,"node_id":"MDQ6VXNlcjEzMTY1NTQw","avatar_url":"https://avatars3.githubusercontent.com/u/13165540?v=4","gravatar_id":"","url":"https://api.github.com/users/RusinovAnton","html_url":"https://github.com/RusinovAnton","followers_url":"https://api.github.com/users/RusinovAnton/followers","following_url":"https://api.github.com/users/RusinovAnton/following{/other_user}","gists_url":"https://api.github.com/users/RusinovAnton/gists{/gist_id}","starred_url":"https://api.github.com/users/RusinovAnton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RusinovAnton/subscriptions","organizations_url":"https://api.github.com/users/RusinovAnton/orgs","repos_url":"https://api.github.com/users/RusinovAnton/repos","events_url":"https://api.github.com/users/RusinovAnton/events{/privacy}","received_events_url":"https://api.github.com/users/RusinovAnton/received_events","type":"User","site_admin":false},"labels":[{"id":251183305,"node_id":"MDU6TGFiZWwyNTExODMzMDU=","url":"https://api.github.com/repos/intljusticemission/react-big-calendar/labels/bug","name":"bug","color":"fc2929","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2018-11-02T11:20:32Z","updated_at":"2018-11-21T07:34:37Z","closed_at":null,"author_association":"NONE","body":"#### Do you want to request a _feature_ or report a _bug_?\r\n\r\n_bug_\r\n\r\n#### What's the current behavior?\r\n\r\nWhen \"month\" is not included in `views` list and `defaultView` prop is not changed from its default value: \"month\", app crashes with an error:  \r\n```\r\nUncaught TypeError: Cannot read property 'title' of undefined\r\n    at ProxyComponent.render (Calendar.js:313)\r\n    at ProxyComponent.hotComponentRender (react-hot-loader.development.js:622)\r\n    at ProxyComponent.proxiedRender (react-hot-loader.development.js:637)\r\n    at finishClassComponent (react-dom.development.js:13727)\r\n    at updateClassComponent (react-dom.development.js:13690)\r\n    at beginWork (react-dom.development.js:14489)\r\n    at performUnitOfWork (react-dom.development.js:17014)\r\n    at workLoop (react-dom.development.js:17054)\r\n    at HTMLUnknownElement.callCallback (react-dom.development.js:149)\r\n    at Object.invokeGuardedCallbackDev (react-dom.development.js:199)\r\n    at invokeGuardedCallback (react-dom.development.js:256)\r\n    at replayUnitOfWork (react-dom.development.js:16366)\r\n    at renderRoot (react-dom.development.js:17148)\r\n    at performWorkOnRoot (react-dom.development.js:17993)\r\n    at performWork (react-dom.development.js:17901)\r\n    at performSyncWork (react-dom.development.js:17873)\r\n    at requestWork (react-dom.development.js:17761)\r\n    at retrySuspendedRoot (react-dom.development.js:17460)\r\n    at wrapped (scheduler-tracing.development.js:200)\r\n```\r\n\r\n#### What's the expected behavior?\r\n\r\nIt takes time to go into source code and figure out why its crashing.  \r\n\r\nWould be nice to at least warn user that they should redefine `defaultView` in  this case if not redefine it automatically or have some feedback."},"comment":{"url":"https://api.github.com/repos/intljusticemission/react-big-calendar/issues/comments/440565431","html_url":"https://github.com/intljusticemission/react-big-calendar/issues/1080#issuecomment-440565431","issue_url":"https://api.github.com/repos/intljusticemission/react-big-calendar/issues/1080","id":440565431,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0MDU2NTQzMQ==","user":{"login":"RusinovAnton","id":13165540,"node_id":"MDQ6VXNlcjEzMTY1NTQw","avatar_url":"https://avatars3.githubusercontent.com/u/13165540?v=4","gravatar_id":"","url":"https://api.github.com/users/RusinovAnton","html_url":"https://github.com/RusinovAnton","followers_url":"https://api.github.com/users/RusinovAnton/followers","following_url":"https://api.github.com/users/RusinovAnton/following{/other_user}","gists_url":"https://api.github.com/users/RusinovAnton/gists{/gist_id}","starred_url":"https://api.github.com/users/RusinovAnton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RusinovAnton/subscriptions","organizations_url":"https://api.github.com/users/RusinovAnton/orgs","repos_url":"https://api.github.com/users/RusinovAnton/repos","events_url":"https://api.github.com/users/RusinovAnton/events{/privacy}","received_events_url":"https://api.github.com/users/RusinovAnton/received_events","type":"User","site_admin":false},"created_at":"2018-11-21T07:34:37Z","updated_at":"2018-11-21T07:34:37Z","author_association":"NONE","body":"@EngrKhizarIqbal as far as I see you don't need to make state from props in child component: \r\n```es6\r\nconstructor(props) {\r\n        super(props);\r\n        this.state = {\r\n            calenderView: this.props.calenderView\r\n        };\r\n    }\r\ncomponentWillReceiveProps(nextProps) {\r\n        if (nextProps && nextProps.calenderView) {\r\n            this.setState({ calenderView: nextProps.calenderView });\r\n        }\r\n    }\r\n```\r\n\r\njust use  `this.props.calenderView` instead of this `this.state.calenderView`. I don't think this is cause of problem but just an antipattern which could be avoided"}}
{"actor":{"display_login":"RusinovAnton"}}