Material-UI's Tabs integration with react router 4?

后端 未结 9 2169
一个人的身影
一个人的身影 2020-12-24 10:58

The new react-router syntax uses the Link component to move around the routes. But how could this be integrated with material-ui?

In my cas

9条回答
  •  再見小時候
    2020-12-24 11:29

    You can use browserHistory instead of React-Router Link component

    import { browserHistory } from 'react-router'
    
    // Go to /some/path.
    onClick(label) {
      browserHistory.push('/${label}');
    }
    
    // Example for Go back
    //browserHistory.goBack()
    
    
       onClick(label)}
      />
    
    

    As you see you can simply push() your target to the browserHistory

提交回复
热议问题