@refinedev/core 4.42.4 → 4.43.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,48 @@
1
1
  # @refinedev/core
2
2
 
3
+ ## 4.43.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#5034](https://github.com/refinedev/refine/pull/5034) [`85bcff15d1e`](https://github.com/refinedev/refine/commit/85bcff15d1efe66c915fe50b504c09d625417fb3) Thanks [@alicanerdurmaz](https://github.com/alicanerdurmaz)! - feat: The `go` function returned by `useGo` now accepts a `resource` object as the `to` parameter.
8
+ From now now, you can provide either a string or a resource object to the `go` function. When a resource object is passed, it will be transformed into the path defined within the resources array of the `<Refine />` component.
9
+
10
+ `to` accepts an object with the following shape to navigate to a resource:
11
+
12
+ | Name | Type | Description |
13
+ | -------- | ----------------------------------------------------------- | ----------------------------------------------------------- |
14
+ | resource | `string` | resource name or identifier. |
15
+ | id | [`BaseKey`][basekey] | required when `action` is `"edit"`, `"show"`, or `"clone"`. |
16
+ | action | `"list"` \| `"create"` \| `"edit"` \| `"show"` \| `"clone"` | action name. |
17
+
18
+ ```tsx
19
+ import { useGo } from "@refinedev/core";
20
+
21
+ const MyComponent = () => {
22
+ const go = useGo();
23
+
24
+ return (
25
+ <Button
26
+ onClick={() => {
27
+ go({
28
+ to: {
29
+ resource: "posts", // resource name or identifier
30
+ action: "edit",
31
+ id: "1",
32
+ }
33
+ query: {
34
+ foo: "bar",
35
+ },
36
+ type: "push",
37
+ });
38
+ }}
39
+ >
40
+ Go Posts With Default Filters
41
+ </Button>
42
+ );
43
+ };
44
+ ```
45
+
3
46
  ## 4.42.4
4
47
 
5
48
  ### Patch Changes