Display Current URL
How can I display the current URL from within a component rendered with Outlet? I've tried some of the hooks built into TanStack Router but I may be missing an import statement or misunderstanding how they work. I essentially am just trying to do "window.location.href" but through TanStack.
4 Replies
optimistic-gold•2y ago
other-emeraldOP•2y ago
do I need to import something to make useRouterState work? VS Code underlines it in red and then it wont render the page
optimistic-gold•2y ago
sure you need to import it from @tanstack/react-router
other-emeraldOP•2y ago
Many thanks 🙏