const match = matchPath(request.url, typeof route.path === 'function' ? route.path() : route.path, route) if (match && match.isExact) { matches.push({ route,
/** * Finds the matching route from a given pathname: * * Ex: getRoute("/top/agility") -> "/top/:metric?/:playerType?" */ export function getRoute(pathname) { const route = ROUTES.find(({ path }) => { const match = matchPath(pathname, path); return match ? match.isExact : false; }); return route ? route.path : null; }
isActive = {(match,location)=>{ if(!match) return false return !match.isExact }}
if (match && match.isExact) { matches.push({ route,
const match = matchPath(request.url, typeof route.path === 'function' ? route.path() : route.path, route) if (match && match.isExact) { matches.push({ route,
/** * Finds the matching route from a given pathname: * * Ex: getRoute("/top/agility") -> "/top/:metric?/:playerType?" */ export function getRoute(pathname) { const route = ROUTES.find(({ path }) => { const match = matchPath(pathname, path); return match ? match.isExact : false; }); return route ? route.path : null; }