Minor Changes
-
#5034
85bcff15d1e
Thanks @alicanerdurmaz! - feat: Thego
function returned byuseGo
now accepts aresource
object as theto
parameter.
From now now, you can provide either a string or a resource object to thego
function. When a resource object is passed, it will be transformed into the path defined within the resources array of the<Refine />
component.to
accepts an object with the following shape to navigate to a resource:Name Type Description resource string
resource name or identifier. id [ BaseKey
][basekey]required when action
is"edit"
,"show"
, or"clone"
.action "list"
|"create"
|"edit"
|"show"
|"clone"
action name. import { useGo } from "@refinedev/core"; const MyComponent = () => { const go = useGo(); return ( <Button onClick={() => { go({ to: { resource: "posts", // resource name or identifier action: "edit", id: "1", } query: { foo: "bar", }, type: "push", }); }} > Go Posts With Default Filters </Button> ); };