using same component for different route path in react-router v4

后端 未结 4 1789
隐瞒了意图╮
隐瞒了意图╮ 2020-12-29 19:19

I am trying to have separate routes but same component for add/edit forms in my react app like the below:


        

        
4条回答
  •  离开以前
    2020-12-29 20:16

    My problem was we used an common path in-between, which causes dynamic path to not working

          
            
            
            {/*  */}
                        
               
            
            
          
    

    So don't use the path like the commented one, now the code is working

    .................
              this.props.history.push("/PolicyPlan/edit/" + row.PolicyPlanId);
    .............    
    

提交回复
热议问题