Skip to content

Commit

Permalink
fix router hook on stable
Browse files Browse the repository at this point in the history
  • Loading branch information
AAGaming00 committed Aug 3, 2024
1 parent d444248 commit b3a5f96
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions frontend/src/router-hook.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,13 @@ class RouterHook extends Logger {

const reactRouterStackModule = findModuleByExport((e) => e == 'router-backstack', 20);
if (reactRouterStackModule) {
this.Route = Object.values(reactRouterStackModule).find(
(e) => typeof e == 'function' && /routePath:.\.match\?\.path./.test(e.toString()),
);
this.Route =
Object.values(reactRouterStackModule).find(
(e) => typeof e == 'function' && /routePath:.\.match\?\.path./.test(e.toString()),
) ||
Object.values(reactRouterStackModule).find(
(e) => typeof e == 'function' && /routePath:null===\(.=.\.match\)/.test(e.toString()),
);
if (!this.Route) {
this.error('Failed to find Route component');
}
Expand Down

0 comments on commit b3a5f96

Please sign in to comment.