Categories
What is better to use to get the current url?
is it better to get the path using window.location.pathname or wrap the component in withRouter and get the path from props? (for different checks)
Answer the question
In order to leave comments, you need to log in
If the component does not need to check anything that provides the withRouter functionality , then why call it? Take from location. Otherwise, withRouter.
Didn't find what you were looking for?
Ask a Question
731 491 924 answers to any question