rubber-blueR
Refine4y ago
6 replies
rubber-blue

use router v6 with search params

Hello 👋

i am trying to programmatically redirect to the create view of a resource and passing some search params.
My code is redirecting correctly but there are no search params in the url:

import { useNavigation } from "@pankod/refine-core";
...
const { push, goBack, createUrl } = useNavigation();
...
 const customSubmit = (values: FieldValues) => {   
   // push to path with query params
   push(createUrl(resourcename), { search: '?sort=date&order=newest'})
   
  }

Can someone point me in the right direction?
Thank you
Was this page helpful?