Hello, I am trying to update url query param on my currentPage state.
Including router in the dependency array results in a infinite render loop and excluding it breaks the react-hooks/exhaustive-deps rule. Any ideas on this?
const [currentPage, setCurrentPage] = useState(1);
useEffect(() => {
router.push({
query: { page: currentPage },
});
}, [currentPage, router]);