E
E
EvgenJunior2021-04-20 20:54:28
React
EvgenJunior, 2021-04-20 20:54:28

How to run Link from React-router-dom in a function?

I need to create a table lookup. When entering text into the input text field, a request must be made to the server and the data corresponding to the request must be returned. I want to implement this with React-Router. The idea is the following: I write text in a field, get data from the field using event.target.value, then I want to add the resulting value to <Link to="api/document/${event.target.value}">. But I don't know how to run <Link to="api/document/${event.target.value}">from some function.
Let me know if you have any ideas about this.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
abberati, 2021-04-20
@abberati

history.push
The documentation has

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question