Answers for "react change url params"

2

append a query string to the url react

history.push({
  pathname: '/dresses',
  search: '?color=blue'
})
Posted by: Guest on May-04-2020
1

history push search params

this.props.history.push({
    pathname: '/client',
    search: "?" + new URLSearchParams({clientId: clientId}).toString()
})
Posted by: Guest on May-16-2020
0

react change url params

if (history.pushState) {
    var newurl = window.location.protocol + "//" + window.location.host + window.location.pathname + '?myNewUrlQuery=1';
    window.history.pushState({path:newurl},'',newurl);
}
Posted by: Guest on May-01-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language