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

_this is not defined #1020

Closed
mnemanja opened this issue Jun 14, 2018 · 6 comments
Closed

_this is not defined #1020

mnemanja opened this issue Jun 14, 2018 · 6 comments

Comments

@mnemanja
Copy link

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

An error occurs when I change a component and the hot reloading refreshes the code. The reference to the this gets lost.
When I refresh the page, the method works.
I then go and change a component, and try the same method, it loses the this reference and it breaks.

Expected behavior

The error should not occur.

Actual behavior

screen shot 2018-06-14 at 13 17 55
screen shot 2018-06-14 at 13 26 09

Environment

React Hot Loader version: 4.2.0 and also 4.3.1

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

  1. node -v: 8.10.0
  2. npm -v: 6.0.1

Then, specify:

  1. Operating system: Mac
  2. Browser and version: Latest chrome

I've noticed this being a standard issue, but in other, resolved issues the problem was with the versions of the this, like _this1...10 etc.

@theKashey
Copy link
Collaborator

This is function actually a function of your component, or it should not be reloaded at all?
Ie #1001

@mnemanja
Copy link
Author

this is a reference to the react component in which the method resides and it tries to access it.

I do not think I'm doing anything wrong react-wise. How can this be fixed?

@theKashey
Copy link
Collaborator

should be fixed in v4.3.3

@mnemanja
Copy link
Author

I can confirm that it's been fixed with v4.3.3.

@theKashey
Copy link
Collaborator

👍

@PavaniGedala23
Copy link

I got the same issue. have updated the react-hot-loader to 4.12.12. Working for me.

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

3 participants