How to set the DefaultRoute to another Route in React Router

前端 未结 11 1250
心在旅途
心在旅途 2020-12-13 02:11

I have the following:

  
    
            


        
11条回答
  •  旧巷少年郎
    2020-12-13 02:17

    I ran into a similar issue; I wanted a default route handler if none of the route handler matched.

    My solutions is to use a wildcard as the path value. ie Also make sure it is the last entry in your routes definition.

    
        
        
        
        
    
    

提交回复
热议问题