Preserve query parameters in react-router

后端 未结 2 932
难免孤独
难免孤独 2020-12-20 14:02

In my react application I have a few parameters that the user comes to the application that provide some information about where they came from. Is there a way using react-r

2条回答
  •  借酒劲吻你
    2020-12-20 14:45

    In this case you can use a Store that holds URL state and you can use browserHistory to push custom history state.

    https://github.com/reactjs/react-router/blob/master/docs/guides/Histories.md#browserhistory

    import { browserHistory } from 'react-router'
    
    browserHistory.push({});
    

    Here is a link how to navigate outside components

提交回复
热议问题