Skip to content

Commit 43872a8

Browse files
committed
wrap in Routes
1 parent 759931e commit 43872a8

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

packages/react-router-dom-v5-compat/lib/components.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,12 @@ import { Router, Routes, Route } from "../react-router-dom";
1414
// v5 isn't in TypeScript, they'll also lose the @types/react-router with this
1515
// but not worried about that for now.
1616
export function CompatRoute(props: any) {
17-
let {path} = props
18-
return <Route path={path} element={<RouteV5 {...props} />} />
17+
let { path } = props;
18+
return (
19+
<Routes>
20+
<Route path={path} element={<RouteV5 {...props} />} />
21+
</Routes>
22+
);
1923
}
2024

2125
export function CompatRouter({ children }: { children: React.ReactNode }) {

0 commit comments

Comments
 (0)