F
F
Faiq Alizade2018-06-12 03:55:52
React
Faiq Alizade, 2018-06-12 03:55:52

How to install react.js on a project?

Hello, I have a working project and I want to add React.js there to work .
This is the way .
But I watched all the videos from YouTube and Stackoverflow, it doesn’t explain how to do it,
wrote the commands
cd myfolder (project folder)
npm init
(then Enter package.json file was created several times)
then
npm install --save react react-dom
These files
5b1f1983bf10d382447880.png
in index.html index.js is connected
5b1f19b66fe09950806638.png
and in index.js it is
5b1f19d4a120f084103321.png
in the package.json file
5b1f19eb76191801537632.png
how to fix what to do?
Even everything he did Here
, after watching these videos, he did exactly the same at the start
npm run it (test is written instead of it in the picture) gave an error of this kind
5b1f1bd9a8436517048410.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Spirin, 2018-06-12
@faiq

You don't have any scripts to run. There is no it script. Apparently, not everything was done on video.
You didn’t install webpack with babel, you didn’t configure webpack.config.
Learning React from video tutorials is not the most efficient way, I think.
In your situation, I can advise, perhaps, to leave these video tutorials, since you can’t follow the instructions on the screen and find some kind of course in the form of a series of articles with code examples and study them.
According to the React connection guide from the official site. In addition to copying code examples, train yourself to read everything that is written in the article. They contain all the information about the tools needed to build and run the application and their settings.
The article is about npm, webpack, babel, presses and configurations. And there is even a link to create-react-app .
I think you should start with create-react-app.
If your English is bad, then I can only recommend reading / watching lessons and articles in Russian.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question