react-router-bootstrap
react-router-bootstrap copied to clipboard
Can't use search params in LinkContainer to prop
Using react-router-bootstrap 0.26.2, react-router-dom 6.8.2 and react-bootstrap 2.7.2
If I had a URLSearchParams to the prop to of LinkContainer I get an error :
Cannot include a '?' character in a manually specified to.pathname field...
If I use a normal <Link> from react-router-dom no problem
I am having this issue, too. Luckily, I think I found a work-around:
<LinkContainer
to={{
pathname: '/url/no/search/params/',
search: '?mySearchParam=' + searchParamValue,
}}
>
<Button variant={'outline-primary'}>Do something</Button>
</LinkContainer>