zac
zac

Reputation: 4918

Refresh current page automatically when script changes

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 ?

Upvotes: 0

Views: 525

Answers (1)

Rukshan Jayasekara
Rukshan Jayasekara

Reputation: 1985

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.

Upvotes: 2

Related Questions