K
K
kamelot432020-12-17 18:27:38
React
kamelot43, 2020-12-17 18:27:38

How to get rid of extra network requests in React?

Guys, welcome) there was one problem. I don't understand how to solve it. The project has several linked pages. there is a search page and when you click on the illustration, you get to the illustration page. react-router is used for routing and axios for sending requests. the essence of the problem is that the requests that I made on the search page are sent to the internal page. those. why requests from one page are also called on another page. I can't understand it. Can you please tell me where to look for the problem? there are basically no requests on the illustration page right now, but they are being sent. thanks in advance.

5fdb785e1a1fb467620426.png
5fdb78705a9f6586886880.png
5fdb7880597f7270718942.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
kamelot43, 2020-12-17
@kamelot43

In short, here's the problem.
moved part of the code to the componentDidMount method.
5fdb817915d35401653416.png

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question