useLocationNavigation
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
parent
005762a1a2
commit
3b74920ece
1 changed files with 2 additions and 2 deletions
|
@ -1,7 +1,7 @@
|
|||
import { useEffect } from "react";
|
||||
import { useHistory } from "react-router-dom";
|
||||
|
||||
export function useLocationNavigation(enabled = false) {
|
||||
export function useLocationNavigation(enabled = false): void {
|
||||
const history = useHistory();
|
||||
|
||||
useEffect(() => {
|
||||
|
@ -12,7 +12,7 @@ export function useLocationNavigation(enabled = false) {
|
|||
const url = new URL(tx.pathname, window.location.href);
|
||||
url.search = tx.search;
|
||||
url.hash = tx.hash;
|
||||
window.location = url.href;
|
||||
window.location.href = url.href;
|
||||
});
|
||||
}
|
||||
|
Loading…
Add table
Reference in a new issue