How can I change ReactJS Project (folder) name?

Viewed 35539

How can I change ReactJS project(folder) name, simply rename the folder name from routing(folder) to react-routing-example(folder).

I found few renaming questions in this stack overflow but they are related to React-native but not Reactjs.

Edit 1: while creating a reactjs app.. i followed the following command:

npm create-react-app router

Here router is my folder name.Now I want to change that name to react-router-example

Thanks in advance.

3 Answers

just rename the project folder then open package.json and change the project name to react-router-example

you can first rename the folder from router to react-routing-example. then change the name from in package.json and package-lock.json.

Or for simplicity use the search tab in vscode to replace the name at once.

Here you can see - example

I also used sudo mv previous-name-of-the-app new-app-name and it worked. I had to manually change the name inside the package.json file and then run localhost from the beginning to see the change.

Related