Some improvements to CompatRoute documentation in the migration guide #9056
              
                Unanswered
              
          
                  
                    
                      kirkobyte
                    
                  
                
                  asked this question in
                v5 to v6 Migration
              
            Replies: 1 comment
-
Beta Was this translation helpful? Give feedback.
                  
                    0 replies
                  
                
            
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
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
elementwithCompatRouteThe migration guide recommends to make this change to fix optional params in paths:
It uses
elementto render the path children. If I understand correctly, those props are eventually ending up on a V5Route, which doesn't supportelementas a prop. So it might make sense to change the example to use `Warning on path for
CompatRoutermay need to warn against arrays inpathThe previous
Routealso used to support arrays as a path parameter:Doing this with
CompatRoutehas 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