Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix remixRouter not existed in conventional routes #4240

Merged
merged 3 commits into from
Jul 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/ninety-tables-help.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@modern-js/runtime': patch
---

fix: fix remixRouter not existed in conventional routes
fix: 修复 remixRouter 在约定式路由下不存在问题
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,16 @@ export const routerPlugin = ({
pickContext: ({ context, pickedContext }, next) => {
const { remixRouter } = context;

// remixRouter is not existed in conventional routes
if (!remixRouter) {
return next({ context, pickedContext });
}

// only export partial common API from remix-router
const router = {
navigate: remixRouter!.navigate,
navigate: remixRouter.navigate,
get location() {
return remixRouter!.state.location;
return remixRouter.state.location;
},
};

Expand Down
Loading