SolidJSS
SolidJSโ€ข3y agoโ€ข
2 replies
vik

Update searchParams with useNavigate

I have a couple of tables. I can select rows of the table and add my rowId's to queryValue

here is a simplified version of my code

const navigate = useNavigate();

 createEffect(() => {

    navigate("/?query=" + selectedIds().join("|"), { resolve: false });
})



This works fine so fare. Better than with searchParams. With searchParams I had the problem, that the value was URLencoded, but I want to keep |
And useNavigate allows me push the changes to browsers history.

Problem:
everytime I select a row, or evertime that Effect is triggred, the browser jumps to the top. I don't want navigate to reload. So a mix of searchParams and navigate would be good?
Was this page helpful?