D
D
Danil Andreev2020-01-27 20:41:16
React
Danil Andreev, 2020-01-27 20:41:16

Why is ReactJS not working?

I would like to apologize for a possibly stupid question. I ask you not to beat for the incorrect use of terms and if additional information is required, then I will be happy to provide it.
There is such a situation, the spring boot project to which I would like to connect react js so that you can build beautiful interfaces.
There are two files, one is index.js
5e2f1db9f2d30554322265.png
The second file, main.html
5e2f21eea100c313401579.png

I wanted the phrase "Hello World" to be inserted into the main.html file using id kek.

After accessing the main.html page from the server, I get this response:
5e2f2221d391c439443786.png

Answer the question

In order to leave comments, you need to log in

3 answer(s)
F
fallus, 2020-01-27
@fallus

Have you completed your project?
npm run build
This will build the project into a *.js file, which you must include manually in your main.html
If I understand the batch correctly, of course.

A
azazazazazaza, 2020-01-28
@azazazazazaza

ReactDOM.render() not just render()

R
Robur, 2020-01-28
@Robur

js file must also be included in html, it will not appear there by itself.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question