{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/flow/issues/6954","repository_url":"https://api.github.com/repos/facebook/flow","labels_url":"https://api.github.com/repos/facebook/flow/issues/6954/labels{/name}","comments_url":"https://api.github.com/repos/facebook/flow/issues/6954/comments","events_url":"https://api.github.com/repos/facebook/flow/issues/6954/events","html_url":"https://github.com/facebook/flow/issues/6954","id":365538699,"node_id":"MDU6SXNzdWUzNjU1Mzg2OTk=","number":6954,"title":"Property is missing in null or undefined","user":{"login":"ixio","id":5647930,"node_id":"MDQ6VXNlcjU2NDc5MzA=","avatar_url":"https://avatars2.githubusercontent.com/u/5647930?v=4","gravatar_id":"","url":"https://api.github.com/users/ixio","html_url":"https://github.com/ixio","followers_url":"https://api.github.com/users/ixio/followers","following_url":"https://api.github.com/users/ixio/following{/other_user}","gists_url":"https://api.github.com/users/ixio/gists{/gist_id}","starred_url":"https://api.github.com/users/ixio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ixio/subscriptions","organizations_url":"https://api.github.com/users/ixio/orgs","repos_url":"https://api.github.com/users/ixio/repos","events_url":"https://api.github.com/users/ixio/events{/privacy}","received_events_url":"https://api.github.com/users/ixio/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-10-01T16:20:59Z","updated_at":"2018-10-02T17:12:53Z","closed_at":"2018-10-02T17:12:53Z","author_association":"NONE","body":"I'm new to flow so I hope I haven't missed anything obvious.\r\n\r\nI'm using it with React and I have a lot of components that have state data coming in from AJAX calls in componentDidMount. I figure that the best way to deal with that is to have state objects as Maybe-Types and initialize them with 'null'.\r\n\r\nHowever I get a lot of errors like:\r\n```\r\nCannot get this.state.user.name because:\r\n • property name is missing in null or undefined [1].\r\n • property name is missing in null [2].\r\n```\r\nEven if I have a condition checking that this.state.user exists.\r\n\r\nIt looks like a bug to me because the conditions seem \"brittle\" (not sure if random would be a better word). I might have 5 properties set up the same way and only some of them will raise errors.\r\n\r\nI tried to make a typical example of my problems:\r\n[flow.org/try link](https://flow.org/try/#0PTAEAEDMBsHsHcBQBLAtgB1gJwC6gEoCmAhgMY4A0oA3qAMKwawB2hzeAvqJFo6AORYS5fgG5EiHAE90hUAGUcxHHIC8NRKFABXAM6EsALlAB+apq2hkAE2PNtqAEYGKFrc2KpCx3TizJmAHMLDkQOcVJoYl1dUABVfSxQQgAPFWZrWIYmVnYAHgA3WBsqRWVCAD4NLV9y0HVzSx1Eu21oaBCJLVJGTFycABEbAFlYbXYACgBKassQUGtYUF9tSEhQaGQAazliZlAAQQApA4ANUFJidtAcJYDkPFqVToshDINp2a1kdYmAQhwAAtkLoAHRPQigvQGGaNJqgIQ4bRYfYTNzwvLWZAFCro+GgPLoCoAGVgxCxQXiiVAoNpeWARLxlnpWJxTKm6NCTWghDwkGQPI8XnqN2BYIhUMSoKFkKE6CipEIE34Aio-AA+vwZgBqASg0i6ApidGI5GopmY7G4-FaQkVBIGUAAYmoQJB4KUKklBlBNg49MZNoJRIAEnJAdFQMRQIEhMpQDLjK6xR7yt6sNLPIR-QzrTa7Q6kgFIEt+TyrLok2W2Fmc4GMcBWXmtBytKFQkA)\r\nIf you remove line 27 there are no more errors (another \"brittle\" condition).\r\n\r\nIf there is a better way to init typed states in React with flow I'm open to learning. However seeing how the errors pop up it looks to me as if there is a bug in flow anyways."},"comment":{"url":"https://api.github.com/repos/facebook/flow/issues/comments/426355515","html_url":"https://github.com/facebook/flow/issues/6954#issuecomment-426355515","issue_url":"https://api.github.com/repos/facebook/flow/issues/6954","id":426355515,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNjM1NTUxNQ==","user":{"login":"ixio","id":5647930,"node_id":"MDQ6VXNlcjU2NDc5MzA=","avatar_url":"https://avatars2.githubusercontent.com/u/5647930?v=4","gravatar_id":"","url":"https://api.github.com/users/ixio","html_url":"https://github.com/ixio","followers_url":"https://api.github.com/users/ixio/followers","following_url":"https://api.github.com/users/ixio/following{/other_user}","gists_url":"https://api.github.com/users/ixio/gists{/gist_id}","starred_url":"https://api.github.com/users/ixio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ixio/subscriptions","organizations_url":"https://api.github.com/users/ixio/orgs","repos_url":"https://api.github.com/users/ixio/repos","events_url":"https://api.github.com/users/ixio/events{/privacy}","received_events_url":"https://api.github.com/users/ixio/received_events","type":"User","site_admin":false},"created_at":"2018-10-02T17:12:53Z","updated_at":"2018-10-02T17:12:53Z","author_association":"NONE","body":"Thank you for the quick answer. Looks like this is indeed not a bug but the current state of affairs. Your solution works well for me. Thanks again."}}
{"actor":{"display_login":"ixio"}}