Skip to content

Commit

Permalink
chore: revert
Browse files Browse the repository at this point in the history
  • Loading branch information
2heal1 committed Aug 28, 2024
1 parent f1c4f1f commit b5cfcef
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions packages/runtime/plugin-runtime/src/router/runtime/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,7 @@ export { Link, NavLink } from './PrefetchLink';
export type { LinkProps, NavLinkProps } from './PrefetchLink';

export const useRouteLoaderData: typeof useRouteData = (routeId: string) => {
const routerIdPrefix =
typeof MODERN_ROUTER_ID_PREFIX === 'string' ? MODERN_ROUTER_ID_PREFIX : '';
let routeIdWithOutPrefix = routeId;
if (routeId.includes(routerIdPrefix)) {
routeIdWithOutPrefix = routeId.replace(routerIdPrefix, '');
}
const realRouteId = routeIdWithOutPrefix.replace(/\[(.*?)\]/g, '($1)');
const realRouteId = routeId.replace(/\[(.*?)\]/g, '($1)');
return useRouteData(realRouteId);
};

Expand Down

0 comments on commit b5cfcef

Please sign in to comment.