usePathname

Returns a string that represents the current pathname.

It takes no arguments and will update every time the route changes.

Edit this page on GitHub.