Getting query parameters from react-router hash fragment

后端 未结 9 1613
心在旅途
心在旅途 2020-12-04 11:55

I\'m using react and react-router for my application on the client side. I can\'t seem to figure out how to get the following query parameters from a url like:



        
9条回答
  •  青春惊慌失措
    2020-12-04 12:23

    You may get the following error while creating an optimized production build when using query-string module.

    Failed to minify the code from this file: ./node_modules/query-string/index.js:8

    To overcome this, kindly use the alternative module called stringquery which does the same process well without any issues while running the build.

    import querySearch from "stringquery";
    
    var query = querySearch(this.props.location.search);
    

提交回复
热议问题