isCurrentRoute
Checks whether the current route name exactly matches the provided route name. This is the narrowest route helper and is useful for active states on single-route links.
Importing
ts
import { isCurrentRoute } from '@almighty-shogun/common'Usage
ts
import { isCurrentRoute } from '@almighty-shogun/common'
const isDashboard = isCurrentRoute('dashboard');Parameters
route: string
Route name to compare against.
Returns
true when the current route name equals route.Type signature
ts
declare function isCurrentRoute(route: string): boolean;