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'})

}
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
5 Replies
fascinating-indigo
fascinating-indigo3y ago
@zomh Hi, I will debug and inform you 🙏
adverse-sapphire
adverse-sapphireOP3y ago
@alicanerdurmaz thanks mate this is my package json version: "@pankod/refine-react-router-v6": "^3.36.2",
fascinating-indigo
fascinating-indigo3y ago
@zomh Sorry for your trouble, I guess we have bug on push() function's type can you use like this now ? we will discuss on monday with the core team and we will fix.

// @ts-ignore
push({ pathname: createUrl(resourceName), search: '?sort=date&order=newest' })

// @ts-ignore
push({ pathname: createUrl(resourceName), search: '?sort=date&order=newest' })
adverse-sapphire
adverse-sapphireOP3y ago
@alicanerdurmaz yea sure. thanks for checking. that works for now
fascinating-indigo
fascinating-indigo3y ago
i will inform you again when we fix types 🙏