Skip to content

Commit

Permalink
fix(packages): fix repeat routing
Browse files Browse the repository at this point in the history
  • Loading branch information
mufeng889 committed Aug 16, 2024
1 parent f94b58b commit 98a7117
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/simple-router/src/router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ class CreateRouter {
const flattenRoutes = routes.flat();

flattenRoutes.forEach(route => {
const matcher = this.matcher.getRecordMatcher(route.name);
if (matcher) return;

// Add route
this.#addRoute(route);
// Transform to react-router route
Expand Down

0 comments on commit 98a7117

Please sign in to comment.