How to get current route in react-router 2.0.0-rc5

后端 未结 9 1276
无人及你
无人及你 2020-12-08 18:05

I have a router like below:


    
        
          


        
9条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-08 18:37

    Works for me in the same way:

    ...
    
      
      ...
    
    ...
    

    And then, I can access "this.props.location.pathname" in the MyComponent function.

    I forgot that it was I am...))) Following link describes more for make navigation bar etc.: react router this.props.location

提交回复
热议问题