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

HMR not reloading index.js #11603

Open
decodejacques opened this issue Oct 31, 2021 · 1 comment
Open

HMR not reloading index.js #11603

decodejacques opened this issue Oct 31, 2021 · 1 comment
Labels

Comments

@decodejacques
Copy link

HMR generally works fine. However, when I modify my index.js file, it doesn't reload the components defined within the file. Here's how to reproduce this behaviour:

  • Create a new react app
  • replace the index.js file
import React from "react"
import ReactDOM from "react-dom"

function Foo() {
  return "first version"
}

ReactDOM.render(
  <React.StrictMode>
    <Foo />
  </React.StrictMode>,
  document.getElementById("root")
)

Load the page and you should see first version

Change the first version string to anything else. The page doesn't change since the component doesn't get reloaded.

@stale
Copy link

stale bot commented Jan 9, 2022

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.

@stale stale bot added the stale label Jan 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant