Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to I update my React version in the ASP.NET Core React/Redux template project?

I've started learning React with Redux and part of my development has seen me want to use the Material UI to make my application more interesting. I created my project in Visual Studio 2017 using the React with Redux template for ASP.NET Core.

I followed the documentation presented at the MatrialUI site and opted to use the CDN option for delivery of the MaterialUI library.

I started creating a few elements and was quickly confronted with the message that I needed to upgrade my react installation to use the Toolbar.

My question is, when we use the Visual Studio React/Redux ASP.NET Core template, how do I update my react installation? Is that carried out via NPM? I can't see any nuget packages relating to React.

Many thanks

like image 832
Yanayaya Avatar asked Sep 13 '25 08:09

Yanayaya


1 Answers

Hey not sure if you found an answer yet but here is my take:

I tried using npm update inside the "ClientApp" folder, but that didn't seem to work. Something that did work though was manually updating each package. So open up a separate terminal -> cd into the ClientApp directory and then

npm i <package name>@<newest version>

so an example would be

npm i [email protected]

Some packages you will definitely need to update are React, React-DOM and rimraf. But you might choose to just update all of them while you're at it. When you're using ASP.NET Core try and go for the 2.2 version, which at least already has Bootstrap 4 installed.

Another tip: With Visual Studio, if you hover over the package names in the package.json file inside, it will show you the latest version. That's gonna make it a bit easier to find out what version you want to update to.

Hope that helped! And if anyone has a better solution please let me know.

like image 93
Lefa Moffat Avatar answered Sep 15 '25 22:09

Lefa Moffat