Skip to content

Commit 62a5e7f

Browse files
authored
fix: should immediately assign routes (#7927)
1 parent d746b2a commit 62a5e7f

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

.changeset/modern-pillows-hear.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@modern-js/runtime': patch
3+
---
4+
5+
fix: should immediately assign routes
6+
fix: 应该立即赋值 routes

packages/runtime/plugin-runtime/src/router/runtime/plugin.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,7 @@ export const routerPlugin = (
161161
},
162162
);
163163

164-
useEffect(() => {
165-
routesContainer.current = routes;
166-
}, [routes]);
164+
routesContainer.current = routes;
167165

168166
beforeCreateRouter = false;
169167

0 commit comments

Comments
 (0)