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

[v4] Arrow functions won't revert back to original state #836

Closed
Kimahriman opened this issue Feb 1, 2018 · 2 comments · May be fixed by Omrisnyk/npm-lockfiles#153
Closed

[v4] Arrow functions won't revert back to original state #836

Kimahriman opened this issue Feb 1, 2018 · 2 comments · May be fixed by Omrisnyk/npm-lockfiles#153
Assignees
Labels

Comments

@Kimahriman
Copy link

Description

This is a weird bug to describe, but if you modify an arrow function and then change it back to it's original, the second update won't work. I can try to put up a full working repo if it's not clear from my example.

Example

Hello.js:

import React from 'react'

class Hello extends React.Component {

  getText = () => {
    return "Hello world"
  }

  render() {
    return this.getText()
  }
}

export default Hello

Expected behavior

Changing the text "Hello world" to "Hello RHL" will change the text in the browser to "Hello RHL". Then changing the text back to "Hello world" will change the text in the browser to "Hello world".

Actual behavior

Changing the text "Hello world" to "Hello RHL" changes the text in the browser to "Hello RHL". Then changing the text back to "Hello world" causes no change in the browser, even though the console indicates that the correct modules were updated.

This isn't just a problem with multiple updates. If you change the text to something new twice, and then back to "Hello world", the first two updates will work, but not the final one.

Environment

React Hot Loader version: 4.0.0-beta.18

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

  1. node -v: v8.4.0
  2. npm -v: 5.6.0

Then, specify:

  1. Operating system: OSX Sierra
  2. Browser and version: 63.0.3239.132
@theKashey theKashey self-assigned this Feb 1, 2018
@theKashey
Copy link
Collaborator

Confirmed. Logic this not detect any difference from the original class, ignoring injected into instance variant.

@gregberge
Copy link
Collaborator

Fixed in v4.0.0-beta.19.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants