Skip to content

Unable to render more than one CompatRoute #8850

Closed Answered by xavier-lc
xavier-lc asked this question in v5 to v6 Migration
Discussion options

You must be logged in to vote

I've managed to get it working with this patch:

diff --git a/index.js b/index.js
index ee2ef576db90bc4e425f62f3765144913fbb9921..43e87a2a5bbdd68a9a3988a25de9952c85eff97c 100644
--- a/index.js
+++ b/index.js
@@ -371,10 +371,10 @@ function createSearchParams(init) {
 
 function CompatRoute(props) {
   let {
-    path
+    location, path
   } = props;
   if (!props.exact) path += "/*";
-  return /*#__PURE__*/createElement(Routes, null, /*#__PURE__*/createElement(Route, {
+  return /*#__PURE__*/createElement(Routes, location ? { location } : null, /*#__PURE__*/createElement(Route, {
     path: path,
     element: /*#__PURE__*/createElement(Route$1, props)
   }));
diff --git a/umd/react-router…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by xavier-lc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant