S
SolidJS2y ago
Grahf

Reset signals when same component is navigated to

In my navbar each menu items navigates to the same location which in turn loads the same component: <li class='text-center p-2 text-textColor'> <A href={/location/${valueOne}/${valueTwo}}> {valueTwo} </A> </li> Lots of these lis to navigate to the same component. But that component uses valueOne and valueTwo to create lots of different signals and other components. Those signals and components end up being different for each li. But the signals never reset each time an li is clicked. onMount never re runs when a li is clicked. Right now only one signal is causing me issues that I need cleared out. But if they would all reset that would be cool or if I could get onMount to re run everytime the li was clicked I could reset them in onMount.
1 Reply
Grahf
GrahfOP2y ago
Like in react you can add a key prop to a component to cause it to re render
Want results from more Discord servers?
Add your server