Skip to content

Commit 29b5910

Browse files
authored
fix: Fix page router (#4500)
Signed-off-by: ya zhou <[email protected]>
1 parent 70b847f commit 29b5910

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

packages/core/src/Pages.tsx

+9-12
Original file line numberDiff line numberDiff line change
@@ -70,19 +70,16 @@ export default function () {
7070
const data = useRouterStore(state => state.data);
7171
const router = React.useMemo(() => {
7272
if (!data.hasInit) {
73-
return useRoutes(
74-
[
75-
...data.routes,
76-
{
77-
path: '*',
78-
Component: Pages,
79-
},
80-
],
81-
{},
82-
);
73+
return [
74+
...data.routes,
75+
{
76+
path: '*',
77+
Component: Pages,
78+
},
79+
];
8380
} else {
84-
return useRoutes(data.routes);
81+
return data.routes;
8582
}
8683
}, [data]);
87-
return router;
84+
return useRoutes(router);
8885
}

0 commit comments

Comments
 (0)