Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

react-hot-loader/babel inside .babelrc plugins breaking child.type reference #516

Closed
baldore opened this issue Mar 13, 2017 · 1 comment
Closed

Comments

@baldore
Copy link

baldore commented Mar 13, 2017

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.

Description

When child.type is used with react-hot-loader@next, react-router-dom@next and webpack@2.2.1, it doesn't recognize the original class/function.

Expected behavior

child.type should recognize the type when checked with the class/function, returning true.

Actual behavior

The comparison child.type === ComponentClass returns false.

Environment

React Hot Loader version:

Run these commands in the project folder and fill in their results:

  1. node -v: 7.2.1
  2. npm -v: 3.10.10

Then, specify:

  1. Operating system: Linux Mint 17
  2. Browser and version: Any browser

Reproducible Demo

Clone https://github.com/baldore/react-tips-and-tricks-workshop/tree/issue-react-hot-loader, run yarn install and yarn start.

Open http://localhost:3000/solution-02 to see the problem.

In .babelrc, uncomment react-hot-loader/babel . If you open the file src/topics/02/solution.js in line 20 and check with a debugger or console.log, you can see that somehow react-hot-loader is modifying the reference.

@calesce
Copy link
Collaborator

calesce commented Mar 13, 2017

Hi, thanks for the issue. This is already being tracked in #304, so I'm going to close this one.

@calesce calesce closed this as completed Mar 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants