Kyros
Not sure whether I'm using reactivity right... (Codereview)
So basically the way I had it before was something on these lines: On my Sidebar component, I would have some buttons that would trigger a navigation, using useNavigate(). I actually switched to some <A /> tags and I'd like to hear about that too, but that shouldn't really matter I think. Anyway, then, In this component, which is the Header component, I would implement useLocation() to get the current path in order to update the text, by mapping it to every possible route. Now, in React that worked for some reason I actually don't quite understand, but intuitively useLocation probably knew when it was changing and triggered a rerender and stuff. Now, in Solid, i just switched the useLocation by React to the useLocation of Solid, and had it like this:
But that didn't work, probably because I didn't implement any form of tracking.
That's it, lemme know what you think of my new implementation :)
15 replies