In my app component, I use a function to set the state of current when a click occurs in the saved component. However, I need to reset this state when the route changes and