-
Notifications
You must be signed in to change notification settings - Fork 801
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
Uncaught ReferenceError: _this5 is not defined #969
Comments
Sounds very similar to #928 |
There was |
I wonder if there's a better way to do this. cc @hzoo @loganfsmyth |
Specifically @theKashey has to keep adding this react-hot-loader/src/proxy/inject.js Lines 146 to 156 in 8a6f69d
|
I'm happy to try to help, but it would go a long way if someone could spell out what this wrapper is doing, since I'm not familiar with the internals of the hot loader. What ends up running at the end, and why isn't Can could in theory generate any number of |
So what we are doing - reading function body from one class, and executing it in the scope of another. as result all variables, possible visible from a function, including @loganfsmyth - this problem could be fixed with easy, if only you know babel. And look like - you know. We just need to place our "regenerator" function inside a constructor, the place where all those Moving regenerator into constructor will not cover some inheritance cases, as long they will have a "place" inside another constructor, but it will be better than current state. |
It seems like, along with the current behavior of injecting
You could special-case if the class has a constructor, also inject
in the constructor? Then you could use that instead. As you said, there are a lot of edge cases in approaches like this, but I feel like the logic in here is already a little scary to me, so it's not much worse with this :P |
Just to double check - adding code like [REGENERATE_METHOD] = (key, code) => this[key] = eval(code); will result regenerator code to be moved inside a constructor? |
I have failed :(
The move itself is relatively easy, but how to add comments :( |
Just add this4-6 for now. Will help for a while. |
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
After hot-reloading a file with multiple components (4 to 5) in one file an error is thrown
Expected behavior
Hot reload should be applied and not crash the component
Actual behavior
What actually happens:
_this5 is not defined
The text was updated successfully, but these errors were encountered: