Some more like a warning. Like if you import something but do not use it.
The requirement for importing React was removed in React 17 (docs) before that you had to import it into every component.
How are you installing React? I would suggest using Vite
Expo is for native apps and you would likely be using React Native and not just React. If you are just starting out learning React I would suggest you start with plain React and get that down a bit first before moving to React Native.
I agree w/ that and am biting off more than I can currently lol. Good looking out. And it was native yes.
Update: I don’t know what I’m reading lol. I know how to use a little of the CMD in Windows but I don’t know what Scaffolding is either. So I’m not sure where to start w/ these docs.
For command line/console/terminal stuff, I generally recommend using a bash based terminal. If you have Git installed locally you can use the Git Bash terminal.
There’s nothing wrong with CMD or Powershell, but when you’re troubleshooting a problem the advice you find will almost always be in syntax for bash.
Yeah I’m still having issues lol. When I copy the GIT (npm) code into my installed Windows GIT, it gives me an issue.
Update: Also, I’m not being lazy, clearly, but this is all a little overwhelming and I honestly know more React than the installation lol. I don’t like this part.
No, it doesn’t have to be from the command line, but it’s mkdir someFolderName in bash if you need it.
Just create a folder somewhere for all your web projects to live in. I’m sure you know how to make a folder normally.
Go inside that folder and right-click in an empty space.
From the context menu select “Git Bash Here” or “Open in terminal” (if you do not see any such menu use “Shift + Right-click” you should see some option for a terminal.
From the terminal run the npm command already posted and follow the prompts.
I’m sorry if I added to the confusion. I wasn’t trying to imply that you need a bash shell in order to build a React project. I just saw that you were asking for help and that you mentioned which terminal software you used, so I was suggesting that terminal commands that you see in instructions are probably a different syntax.
We can’t really do more than guess when it comes to problems with your local development environment.
React is a library. You can add it to your package via a package manager like npm or yarn. Then you can start writing React components. If you added the package but haven’t used React methods yet, that would explain the warning you mentioned in your first post.
If you’re building a new React project and you want to quickstart it, you can use create react app.
Well I appreciate the help and the clearing up on the confusion. I just need to create a folder from/in my Git bash and then (apparently? lol) I should be able to start importing and working on project tutorials.
Update: Here is what I get when I copy over the code from the link into my Git.
It looks like you probably didn’t add the node directory to your system PATH variable. In order to use a command, the computer has to know the location of the files that contain that command.
The PATH is set up when you install Node.js unless you intentionally uncheck the option. Maybe just uninstall and reinstall Node.js and make sure not to change the install settings.
You can also use nvm-windows which can be nice (let you switch node versions on the fly)
I would really not suggest using create-react-app, it is slow as molasses compared to Vite.
Here is a terminal-only install.
This will install it to a folder on your desktop for convenience (the code . command assumes you have VS Code installed).
Start menu > type “git bash” and hit Enter.
Run each command, one at a time.
cd desktop
mkdir websites
cd websites
npm create vite@latest my-react-app -- --template react
cd my-react-app
npm i
code .
npm run dev