Minor Changes
-
#6330
5a81b35bc1eedbecb4b6c531a2fa5235dd0caf31
Thanks @alicanerdurmaz! - feat: add<Link />
component to navigate to a resource with a specific action. Under the hood, It usesuseGo
to generate the URL.Usage
import { Link } from "@refinedev/core"; const MyComponent = () => { return ( <> {/* simple usage, navigates to `/posts` */} <Link to="/posts">Posts</Link> {/* complex usage with more control, navigates to `/posts` with query filters */} <Link go={{ query: { // `useTable` or `useDataGrid` automatically use this filters to fetch data if `syncWithLocation` is true. filters: [ { operator: "eq", value: "published", field: "status", }, ], }, to: { resource: "posts", action: "list", }, }} > Posts </Link> </> ); };
-
#6330
5a81b35bc1eedbecb4b6c531a2fa5235dd0caf31
Thanks @alicanerdurmaz! - chore: From now on,useLink
returns<Link />
component instead of returningrouterProvider.Link
.Since the
<Link />
component usesrouterProvider.Link
under the hood with leveraginguseGo
hook to generate the URL there is no breaking change. It's recommended to use the<Link />
component from the@refinedev/core
package instead ofuseLink
hook. This hook is used mostly for internal purposes and is only exposed for customization needs.
Patch Changes
-
#6327
c630b090539082b5166b508053f87274624c794e
Thanks @Anonymous961! - fix(core): added ability to returnundefined
to fallback to the default notification config when using the function form insuccessNotification
anderrorNotification
props. -
#6353
a0f2d7bbef3093e11c3024bb7fa2a0ffc3ce9e10
Thanks @alicanerdurmaz! - fix: Thelabel
androute
fields inuseMenu().menuItems
were marked as deprecated, but they are not actually deprecated. This issue was caused bymenuItems
extending fromIResourceItem
, however,menuItems
populates these fields and handles deprecation of these fields internally. This change removes the deprecation warning for these fields.export const Sider = () => { const { menuItems } = useMenu(); menuItems.map((item) => { // these are safe to use console.log(item.label); console.log(item.route); item.children.map((child) => { // these are safe to use console.log(child.label); console.log(child.route); }); }); return <div>{/* ... */}</div>; };
-
#6386
bfe28f0316b3623aaef0b60ae39ebe24939dd0af
Thanks @hugorezende! - fix(core): wrapsetFilters
andsetSorters
methods withuseCallback
to prevent looping re-rendersWith this we can use the setFilters as dependencies inside useEffects without infinite loop since state changes in the hook won't cause the functions to be re-assigned