Some improvements to CompatRoute documentation in the migration guide #9056
Unanswered
kirkobyte
asked this question in
v5 to v6 Migration
Replies: 1 comment
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The "1) Render CompatRoute elements inside of Switch" section of the migration guide has a few things which I think might need to be clarified.
Using
element
withCompatRoute
The migration guide recommends to make this change to fix optional params in paths:
It uses
element
to render the path children. If I understand correctly, those props are eventually ending up on a V5Route
, which doesn't supportelement
as a prop. So it might make sense to change the example to use `Warning on path for
CompatRouter
may need to warn against arrays inpath
The previous
Route
also used to support arrays as a path parameter:Doing this with
CompatRoute
has bad results since it will have/*
added to the V6 route, making the path/path-one,/path-two,/*
react-router/packages/react-router-dom-v5-compat/lib/components.tsx
Lines 16 to 24 in 334589b
Beta Was this translation helpful? Give feedback.
All reactions