Home > Software design >  Refresh current page automatically when script changes
Refresh current page automatically when script changes

Time:10-14

In recent react app I install nodemon globally and modified package.json to add dev command like this:

"scripts": {
    "start": "react-scripts start",
    "dev": "nodemon ./app.js",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },

I start the app like this npm run dev but problem in any changes the development server start again opening new tab. How I make only current tab refreshed ?

CodePudding user response:

Why not simply use npm start?

react-scripts start sets up the development environment and starts a server, as well as hot module reloading. Read more here.

  • Related