history.push({
pathname: '/dresses',
search: '?color=blue'
})
const Users = () => {
const navigate = useNavigate();
const goToPosts = () =>
navigate({
pathname: '/posts',
search: '?sort=date&order=newest',
});
return (
<div>
Users
<button onClick={goToPosts}>Go to Posts</button>
</div>
);
};
history.push({
pathname: '/dresses',
search: '?color=blue'
})
or
history.push('/dresses?color=blue')