{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/flow/issues/7228","repository_url":"https://api.github.com/repos/facebook/flow","labels_url":"https://api.github.com/repos/facebook/flow/issues/7228/labels{/name}","comments_url":"https://api.github.com/repos/facebook/flow/issues/7228/comments","events_url":"https://api.github.com/repos/facebook/flow/issues/7228/events","html_url":"https://github.com/facebook/flow/issues/7228","id":387260398,"node_id":"MDU6SXNzdWUzODcyNjAzOTg=","number":7228,"title":"Flow unable to understand trivial variable equivalence when determining refinements","user":{"login":"rkrv","id":840660,"node_id":"MDQ6VXNlcjg0MDY2MA==","avatar_url":"https://avatars0.githubusercontent.com/u/840660?v=4","gravatar_id":"","url":"https://api.github.com/users/rkrv","html_url":"https://github.com/rkrv","followers_url":"https://api.github.com/users/rkrv/followers","following_url":"https://api.github.com/users/rkrv/following{/other_user}","gists_url":"https://api.github.com/users/rkrv/gists{/gist_id}","starred_url":"https://api.github.com/users/rkrv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rkrv/subscriptions","organizations_url":"https://api.github.com/users/rkrv/orgs","repos_url":"https://api.github.com/users/rkrv/repos","events_url":"https://api.github.com/users/rkrv/events{/privacy}","received_events_url":"https://api.github.com/users/rkrv/received_events","type":"User","site_admin":false},"labels":[{"id":149548548,"node_id":"MDU6TGFiZWwxNDk1NDg1NDg=","url":"https://api.github.com/repos/facebook/flow/labels/incompleteness","name":"incompleteness","color":"5319e7","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-12-04T12:21:19Z","updated_at":"2018-12-07T19:59:42Z","closed_at":null,"author_association":"NONE","body":"I ran into a issue where flow will not recognise a type of a copied variable for conditional rendering in React:\r\n\r\nhttps://flow.org/try/#0PQKgBAAgZgNg9gdzCYAoVBLAtgBzgJwBcwAlAUwEMBjYqfOLMAcn0pqYG50q4A7AZ2IAVMgA9iAXjAAKAN5gAFoSwwwAXwBcYeUpVbB+DLwDm6gJRgJAPkXKYXVFACuvGhj5gA6vgo4cZfDlbFXUtHTsAfn1CQxNzbVQwMB4BYgUKfgAJO0tg+0SwVkInfF5FDOyQgDIqsAAeEXE8iVldGDUwYCsuNVQgA\r\n\r\n```js\r\nconst Text = ({ html }: { html: string }) => html;\r\n\r\nfunction Wrapper({ html }: { html?: string }) {\r\n  const hasHtml = html;\r\n  return hasHtml && <Text html={html} />;\r\n}\r\n```\r\n\r\nFunny enough, this will work:\r\n\r\nhttps://flow.org/try/#0PQKgBAAgZgNg9gdzCYAoVBLAtgBzgJwBcwAlAUwEMBjYqfOLMAcn0pqYG50q4A7AZ2IAVMgA9iAXjAAKAN5gAFoSwwwAXwBcYeUpVbB+DLwDm6gJRgJAPkXKYXVFACuvGhj5gA6vgo4cZfDlbFXUtHTsAfn1CQxNzbVQwMGBgMB4BYgUKfgAJO0tg+0SwVkInfF5CsAAyarAAHhFxQolZXRg1ZKsuNVQgA\r\n\r\n```js\r\nconst Text = ({ html }: { html: string }) => html;\r\n\r\nfunction Wrapper({ html }: { html?: string }) {\r\n  return html && <Text html={html} />;\r\n}\r\n```\r\n\r\nAm I missing something?"},"comment":{"url":"https://api.github.com/repos/facebook/flow/issues/comments/445348506","html_url":"https://github.com/facebook/flow/issues/7228#issuecomment-445348506","issue_url":"https://api.github.com/repos/facebook/flow/issues/7228","id":445348506,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0NTM0ODUwNg==","user":{"login":"villesau","id":2647016,"node_id":"MDQ6VXNlcjI2NDcwMTY=","avatar_url":"https://avatars1.githubusercontent.com/u/2647016?v=4","gravatar_id":"","url":"https://api.github.com/users/villesau","html_url":"https://github.com/villesau","followers_url":"https://api.github.com/users/villesau/followers","following_url":"https://api.github.com/users/villesau/following{/other_user}","gists_url":"https://api.github.com/users/villesau/gists{/gist_id}","starred_url":"https://api.github.com/users/villesau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/villesau/subscriptions","organizations_url":"https://api.github.com/users/villesau/orgs","repos_url":"https://api.github.com/users/villesau/repos","events_url":"https://api.github.com/users/villesau/events{/privacy}","received_events_url":"https://api.github.com/users/villesau/received_events","type":"User","site_admin":false},"created_at":"2018-12-07T19:59:42Z","updated_at":"2018-12-07T19:59:42Z","author_association":"NONE","body":"@rkrv I got very definite answer to same problem here: https://github.com/facebook/flow/issues/6146#issuecomment-439139904\r\n\r\nThis has been reported many times already. I think that it's because the restriction is not well documented and the use case is pretty idiomatic JS. If you know the restriction, it's very easy to avoid it and still being able write clean code. Just avoid destructing objects that has this kind of \"cross dependencies\""}}
{"actor":{"display_login":"villesau"}}