Within the push
method of hashHistory
, you can specify your query parameters. For instance,
history.push({
pathname: '/dresses',
search: '?color=blue'
})
or
history.push('/dresses?color=blue')
You can check out this repository for additional examples on using history
More Related Contents:
- React-router-v6 access a url parameter
- Detecting user leaving page with react-router
- React router changes url but not view
- Programmatically navigating in React-Router v4
- react-router-dom v6 useNavigate passing value to another component
- Why do I get the error “expressions must have one parent element”, how do I fix this?
- What is the best way to redirect a page using React Router? [closed]
- React Router Pass Param to Component
- How to stop /#/ in browser with react-router?
- react-router-dom useParams() inside class component
- Cannot read property ‘history’ of undefined (useHistory hook of React Router 5)
- What is withRouter for in react-router-dom?
- How to tell webpack dev server to serve index.html for any route
- Using React-Router with a layout page or multiple components per page
- Target Active Link when the route is active in Next.js
- Use history.push in action creator with react-router-v4?
- How do I avoid ‘Function components cannot be given refs’ when using react-router-dom?
- Error: useHref() may be used only in the context of a component. It works when I directly put the url as localhost:3000/experiences
- react app showing empty page when redirecting on production build
- Page layout broken in React Router v6
- React App goes blank after importing React-Router-Dom
- Pass object through Link in react router
- Automatic redirect after login with react-router
- How to nest routes in React Router v4?
- React router and this.props.children – how to pass state to this.props.children
- using NavLink with external URL
- Children won’t render when using a layout in ReactJS
- How to go back to previous route in react-router-dom v6
- React Router Navigate pathing
- How to remove the hash from the url in react-router