FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

HMR not reloading index.js · Issue #11603 · react/create-react-app · GitHub

HMR not reloading index.js #11603

Description

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL