O
O
Olga2018-03-28 20:31:56
React
Olga, 2018-03-28 20:31:56

How to track a click on a link?

The page has a menu. You need to find out that the transition to the page from the menu was made.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Suntsev, 2018-03-29
@melkaya94

To find out that there was a transition from the menu, a thousand ways, here it is rather necessary to clarify for what purpose it is necessary to know and in which component?
For example, the current route can be viewed in this.props.route in a component child of the route, or through the store if you use redux-route.
If you need this for statistics, you can use the webvisor from Yandex metrics by simply connecting it to index.html

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question