我想要搜索params并添加params到 URL,但每次都得到空数组。
示例网址 -http://localhost:3000/buildings?search_query=test&page=2
constructor(props) {
super(props);
const params: URLSearchParams = new URLSearchParams(this.props.location.search);
console.log(params); //Getting empty object {}
}
Run Code Online (Sandbox Code Playgroud)