A
A
arseniy882020-11-17 15:17:45
JavaScript
arseniy88, 2020-11-17 15:17:45

Is it correct to do history.push on button click?

Is it correct to do history.push on button click?

There is a page with posts you can filter by category, type and article author.

Is it the right approach when you click, for example, on filtering a category, the id data of this category is stored in redux and then in the parent component it is pushed to history.

If possible, you can leave links to articles, examples of how to implement this.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir, 2020-11-17
@arseniy88

React's URL history is managed by react Router ( https://reactrouter.com/ )
If you're going to push a new URL, why not just navigate to it with React Router and then process the changed parameters?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question