i.m using useRouter provided by next/navigation but these methods seem to do nothing
const handleSortChange = (updatedSort: string) => {
const updatedQuery = new URLSearchParams({
sort: updatedSort,
season: seasonSelected,
});
console.log(updatedQuery.toString());
router.replace(`${path}?${updatedQuery.toString()}`); // does nothing
window.location.replace(`${path}?${updatedQuery.toString()}`); // works
};
const handleSeasonChange = (updatedS: string) => {
const updatedQuery = new URLSearchParams({
sort: sortSelected,
season: updatedS,
});
console.log(updatedQuery.toString());
router.replace(`${path}?${updatedQuery.toString()}`); // does nothing
window.location.replace(`${path}?${updatedQuery.toString()}`); // works
};
am i doing something wrong?