I am trying to refresh/reload an page in a react functional component. But when i call
window.location.reload()
in useEffect() hook, the page keeps refreshing forever. I want it to refresh only once after it mounts. How to achieve that? So far I tried this:
useEffect(
() => {
setNotificationCount();
window.location.reload();
},[]
)