I want to remove the location state after navigating to other page.
Suppose I am in page1. I render some state using useEffect.
useEffect
const Page1 =