useParams not working

hey, I wanted to have my fetch functions for resources in separate file but when I use useParams inside of the fetch function it works just fine the first time but if I switch to different route it returns a proxy object with no params in my layout its not detecting the params even though its there SidePanel.jsx:
14 Replies
KokoNeot
KokoNeotOP2y ago
params is always empty proxy object, and params.guildID is undefined
KokoNeot
KokoNeotOP2y ago
KokoNeot
KokoNeotOP2y ago
KokoNeot
KokoNeotOP2y ago
The SidePanel component is in DashboardLayout layout
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
KokoNeot
KokoNeotOP2y ago
no, i never used codesandbox and never heard of stackblitz
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
KokoNeot
KokoNeotOP2y ago
here is a showcase of whats happening
KokoNeot
KokoNeotOP2y ago
forgot to show the routes
KokoNeot
KokoNeotOP2y ago
I expect to have params in the SidePanel component. I'm aware that the SidePanel component is part of DashboardLayout and that is rendered on route /dashboard but it has an outlet component which allows me to show stuff on different routes. What I think is happening here is that the SidePanel component (along with DashboardLayout) thinks that they are only on /dashboard route even though they are at /dashboard/:guildID(/leaderboard) your stackblitz example works because you have the guildID in the <A> href "hardcoded" I need it dynamic based on the route damn I found the issue I had to restructure my routes like so
KokoNeot
KokoNeotOP2y ago
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server