useHistory
The useHistory hook returns full History object that allows you to subscribe to history changes etc.
info
The main purpose of this hook is to have an easier backwards compatibility with the previous API. Plus, have a possibility to subscribe to History if such a need ever exists.
In all the other cases, we recommend using useNavigate hook (PUSH, REPLACE, POP).