Value returned from routeData is undefined

The value returned from routeData isn't defined, even after waiting before accessing
18 Replies
Tommypop
TommypopOP2y ago
The code relating to the routeData is pretty much copied and pasted from the docs
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Tommypop
TommypopOP2y ago
I've tried using it in JSX
Tommypop
TommypopOP2y ago
Could it be due to where it is located in the layout tree?
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Tommypop
TommypopOP2y ago
the function isn't even called I've added a log, which doesn't run
Tommypop
TommypopOP2y ago
Tommypop
TommypopOP2y ago
Here's the JSX I just added it there for testing routeData doesn't even get called
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Tommypop
TommypopOP2y ago
Done
Tommypop
TommypopOP2y ago
Still undefined and none of those logs are triggered Apart from the one in the memo Which prints undefined
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Tommypop
TommypopOP2y ago
I'm looking in the terminal Yep :) Could it be because it's in the same file as a Context Provider or because it's before the routes in the tree Actually, that sounds like it could be the problem
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Tommypop
TommypopOP2y ago
Yeah Awesome I guess I'll just fall back on my old way Which needs artificial delay to work for some reason :) Yeah And even then it's not reliable but at least it's only on initial page load I've put it inside of a route and still nothing :(
Tommypop
TommypopOP2y ago
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Tommypop
TommypopOP2y ago
Yeah Good idea Thanks for all the help and advice
Want results from more Discord servers?
Add your server