github refinedev/refine @refinedev/core@4.44.11

Patch Changes

  • #5199 2b8d658a17a Thanks @aliemir! - Exported BaseOption type as successor of the deprecated Option type. BaseOption is { label: any; value: any; }.

    Usage of the deprecated Option type was correctly assuming that the value property of the option is of type string. This assumption was wrong and now the types are changed to reflect the correct values of options with the ability to change it via 4th generic type TOption of useSelect hook.

  • #5199 2b8d658a17a Thanks @aliemir! - Reverted the faulty assumption on option values of useSelect hook to be of type string. Now changed the types and the logic to reflect the correct values of options with the ability to change it via 4th generic type TOption of useSelect hook. (Reverted PR #5160)

    By default TOption will be equal to BaseOption type which is { label: any; value: any; }. If you want to change the type of options, you can do it like this:

    import { HttpError, useSelect } from "@refinedev/core";
    
    type MyData = {
        id: number;
        title: string;
        description: string;
        category: { id: string };
    };
    
    type Option = { label: MyData["title"]; value: MyData["id"] }; // equals to { label: string; value: number; }
    
    useSelect<MyData, HttpError, MyData, Option>({
        resource: "posts",
    });
  • #5194 9df999ca643 Thanks @fitrahfm! - fix: use relative path instead of path alias to import FlatTreeItem

    Using path alias causes imported types being any during build/compilation process which should be TreeMenuItem[]

  • #5201 760cfbaaa2a Thanks @aliemir! - Exported the flattenObjectKeys and propertyPathToArray helpers from @refinedev/core package.

Don't miss a new refine release

NewReleases is sending notifications on new releases.