A
A
ArturPetrov2019-07-26 18:40:48
JavaScript
ArturPetrov, 2019-07-26 18:40:48

How to correctly set the path to the file and component?

I want to make a link to the comment.js page on the HomePage.js page:
5d3b1d7a2f8d2108699505.png
comment.js page:
5d3b1d9ab945e076997290.png
But it gives an error that the file is not found: 5d3b1e53a6209368508655.png
I tried the comment.js file: put it in the same folder where HomePage.js is located, that is, in pages and register another way but also error.
What is the reason?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Spirin, 2019-07-26
@ArturPetrov

What is the reason?

That you are doing everything wrong.
You need to use client routing. For example react-router-dom .
React Training / React Router

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question