Install Next with older version of React in it - reactjs

I'm a beginner and I'm starting a new project with Next.js, but I need to install the 17.0.2 version of React (or any that is below 18) since Material UI does not work very well with the latest version of React.
I tried a lot of commands and searches to find a way to start a new project with a certain version of React or give it a downgrade correctly.
Currently I'm using Yarn.

Related

Using ThreeJS with React v16

I am trying to render 3D files in my react project. I am using ThreeJS for my react project of version 16.13.1. After installing #react-three/fiber & #react-three/drei these packages, I am getting error of Module not found: Can't resolve 'react-dom/client'. After searching solution for this I get to know that for these we have to upgrade React version to 17 or above. I did it in demo project & it worked. But the restriction is that I can not update actual project version from 16 to 18 as it will change or break so many things as well as I have to take care of other dependencies. Is there any solution available for using ThreeJS with React v16.
Or if there is any other way or different packages available to render 3D files (like .glb, .gltf) please share with me.
Thank you in advance.
How to find a version of a library that supports particular version of react?
Google <library-name> npm
Go to npm page
Go to repository (usually github)
Open package.json
Check version of react; if it's matching your version go to 7.
Change tag to some previous version; go to 5.
#react-three/fiber & #react-three/drei for react 16.13.1
These two should work:
#react-three/fiber 4.2.21
#react-three/drei 3.2.0
npm install #react-three/fiber#4.2.21 #react-three/drei#3.2.0
Disclaimer
You can never know if the packages work without trying. Many things changes and bug fixes only apply to the newest versions.
I found one package react-3d-viewer to render 3D files which perfectly work for me.
Google model viewer also works and it comes with variety of props which is good for customization of rendered 3D model.
https://github.com/dwqdaiwenqi/react-3d-viewer
https://modelviewer.dev/docs/index.html

Is there any way to install latest reactJs app on windos7

I am new to React. Although I am studying the react, I am not too clear about the concept react and react-native.
When trying to install react native app I am getting an error:
Command: npx expo-cli init reactapp
ERROR: Node.js v13.14.0 is no longer supported.
expo-cli supports following Node.js versions:
=12.13.0 <15.0.0 (Maintenance LTS)
=16.0.0 <17.0.0 (Active LTS)
When tried to install the latest version I am not able to get that on windows7 can anyone let me know if there's any way to install the latest React version on my OS? Please don't suggest changing the OS. I cant do that.
Your problem is not related to Windows7, it is related to your version of NodeJS (the back-end server-side environment that works with ReactJS). First you install Node, then you install React -- Node is required for React development.
Upgrade your version of NodeJS and all should work.
For your other question:
ReactJS is the programming library (kind of like a framework) for writing React apps. ReactNative (poorly named) is a specialized version of React that is specifically for writing mobile (phone) applications.
You can review this link to see how to install a specific version of NodeJS:
https://www.geeksforgeeks.org/how-to-install-the-previous-version-of-node-js-and-npm/
Here is information re the latest versions of Node that works with Windows7:
NodeJS for windows 7
Check your node version by node -v and if it is older than 12.13.0, try upgrading it to the latest LTS version. hope this resolves your problem.

Survey JS used in React App using version 17.0.1?

I am trying to implement the Survey Creator from Survey JS in my React App. I am a new developer so could you explain how I fix this? I'm currently using Material UI in my app. If I switch to version 16.5.0 of react and react-dom, then material UI says I need a newer version of react and react-dom. Screenshot of issue below. I'm currently on react and react-dom version 17.0.1
what shows up in the console
This is a common issue of incompatible dependencies. React 17.0.1 is quite newer, hence all packages have not been updated to this version.
In your case, material-ui is suited for this version but not Survey Js. What you can do is keeping react#16.5.0 react-dom#16.5.0 and downgrading material's version, 4.11.2 might be good for instance.

How to downgrade react native version while creating project, not after

previously we were using react native ver 0.59.0 and somehow it's upgraded to ver 0.60.3. As we know that their many major changes in this version, so now with the latest versions we are facing many issues in the development. So are there any ways to downgrade it to ver 0.59.0 again.
So please suggest us anyway to do the same.
Thanks in advance.
You can specify which React Native version to use when creating the project through the CLI by passing the version flag:
react-native init newproject --version react-native#0.59.0

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
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 react#16.8.6
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.

Resources