0
I’m developing a dropdown, and each dropdown item will have a link to redirect to the same page, which will change are the parameters on it.
I want to know how to get the full URL already with the parameters that were used in other dropdown and update the same parameter if applicable.
Example:
/caminho?parametro1=carro
/caminho?parametro2=azul
/caminho?parametro1=carro¶metro2=azul
/caminho?parametro1=carro¶metro2=azul¶metro3=grande
/caminho?parametro1=carro¶metro2=azul¶metro3=pequeno
I want to keep the URL that is already with the previous parameters and just add one more parameter to it and, if the dropdown is used again, it updates the value of the same parameter.
What I’ve done has been so far:
<Linked
to={{
pathname: '/caminho',
search: `?parametro3=${option}`,
}}>
{option}
</Linked>