{"action":"created","issue":{"url":"https://api.github.com/repos/gaearon/react-hot-loader/issues/938","repository_url":"https://api.github.com/repos/gaearon/react-hot-loader","labels_url":"https://api.github.com/repos/gaearon/react-hot-loader/issues/938/labels{/name}","comments_url":"https://api.github.com/repos/gaearon/react-hot-loader/issues/938/comments","events_url":"https://api.github.com/repos/gaearon/react-hot-loader/issues/938/events","html_url":"https://github.com/gaearon/react-hot-loader/issues/938","id":315580578,"number":938,"title":"React component type is confused","user":{"login":"zlk89","id":7234480,"avatar_url":"https://avatars0.githubusercontent.com/u/7234480?v=4","gravatar_id":"","url":"https://api.github.com/users/zlk89","html_url":"https://github.com/zlk89","followers_url":"https://api.github.com/users/zlk89/followers","following_url":"https://api.github.com/users/zlk89/following{/other_user}","gists_url":"https://api.github.com/users/zlk89/gists{/gist_id}","starred_url":"https://api.github.com/users/zlk89/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zlk89/subscriptions","organizations_url":"https://api.github.com/users/zlk89/orgs","repos_url":"https://api.github.com/users/zlk89/repos","events_url":"https://api.github.com/users/zlk89/events{/privacy}","received_events_url":"https://api.github.com/users/zlk89/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-04-18T17:52:20Z","updated_at":"2018-04-18T21:12:26Z","closed_at":null,"author_association":"NONE","body":"If you are reporting a bug or having an issue setting up React Hot Loader, please fill in below. For feature requests, feel free to remove this template entirely.\r\n\r\n### Description\r\n\r\nWhat you are reporting:\r\n\r\nAll react nodes are created by a proxy function in react-hot-loader now, and this affects all codes like `node.type === Component`. This assertion will always be false.\r\nAnd this is very common in many codebases, like react bootstrap [here](https://github.com/react-bootstrap/react-bootstrap/blob/master/src/ListGroup.js#L55).\r\n\r\n### Expected behavior\r\n\r\nWhat you think should happen:\r\n\r\nSee function location, it is from correct file location, and `node.type === Component` is true.\r\n<img width=\"322\" alt=\"screenshot 2018-04-17 23 14 58\" src=\"https://user-images.githubusercontent.com/7234480/38914749-99a461ee-4295-11e8-9d72-61e6310d029a.png\">\r\n\r\n\r\n### Actual behavior\r\n\r\nWhat actually happens:\r\n\r\nreact node's type has dynamic function location, which I believe is a dynamic generated, see screenshot:\r\n<img width=\"340\" alt=\"screenshot 2018-04-17 23 15 25\" src=\"https://user-images.githubusercontent.com/7234480/38914704-64693aea-4295-11e8-81b0-ea55f70aee53.png\">\r\n\r\n`[[FunctionLocation]]: VMxxx` is a dynamically generated file in chrome, and `node.type === Component` is false now.\r\n\r\n### Environment\r\n\r\nReact Hot Loader version:\r\n\r\nRun these commands in the project folder and fill in their results:\r\n\r\n1.  `node -v`: v6.9.5\r\n2.  `npm -v`: 5.8.0\r\n\r\nThen, specify:\r\n\r\n1.  Operating system: Mac\r\n2.  Browser and version: Chrome Version 65.0.3325.181 (Official Build) (64-bit)\r\n\r\n\r\n### Reproducible Demo\r\n\r\nPlease take the time to create a new project that reproduces the issue.\r\n\r\nYou can copy your project that experiences the problem and start removing things until you’re left with the minimal reproducible demo. This helps contributors, and you might get to the root of your problem during that process.\r\n\r\nPush to GitHub and paste the link here.\r\n\r\n- git clone https://github.com/zlk89/react-hot-loader-clear/tree/hmr-function-location-bug, checkout branch `hmr-function-location-bug`\r\n- `npm install`\r\n- `npm run start` and open `localhost:3000` in browser\r\n  - You should see `Correct!`\r\n- Then enable any one of these lines: \r\n  - https://github.com/zlk89/react-hot-loader-clear/blob/hmr-function-location-bug/src/App.js#L2\r\n  - https://github.com/zlk89/react-hot-loader-clear/blob/hmr-function-location-bug/src/App.js#L21\r\n  - https://github.com/zlk89/react-hot-loader-clear/blob/hmr-function-location-bug/.babelrc#L8\r\n- and then rerun `npm run start`\r\n    - Refresh page, you should see `Wrong!` in browser\r\n"},"comment":{"url":"https://api.github.com/repos/gaearon/react-hot-loader/issues/comments/382531039","html_url":"https://github.com/gaearon/react-hot-loader/issues/938#issuecomment-382531039","issue_url":"https://api.github.com/repos/gaearon/react-hot-loader/issues/938","id":382531039,"user":{"login":"theKashey","id":582410,"avatar_url":"https://avatars0.githubusercontent.com/u/582410?v=4","gravatar_id":"","url":"https://api.github.com/users/theKashey","html_url":"https://github.com/theKashey","followers_url":"https://api.github.com/users/theKashey/followers","following_url":"https://api.github.com/users/theKashey/following{/other_user}","gists_url":"https://api.github.com/users/theKashey/gists{/gist_id}","starred_url":"https://api.github.com/users/theKashey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theKashey/subscriptions","organizations_url":"https://api.github.com/users/theKashey/orgs","repos_url":"https://api.github.com/users/theKashey/repos","events_url":"https://api.github.com/users/theKashey/events{/privacy}","received_events_url":"https://api.github.com/users/theKashey/received_events","type":"User","site_admin":false},"created_at":"2018-04-18T21:12:26Z","updated_at":"2018-04-18T21:12:26Z","author_association":"COLLABORATOR","body":"We know this problem, but could not do anything to solve it. At least today.\r\nThe only proper way to write your code is to compare the _same things_:\r\n```js\r\nnode.type === <Component />.type\r\n```"}}
{"actor":{"display_login":"theKashey"}}