Patch Changes
-
#5199
2b8d658a17a
Thanks @aliemir! - ExportedBaseOption
type as successor of the deprecatedOption
type.BaseOption
is{ label: any; value: any; }
.Usage of the deprecated
Option
type was correctly assuming that thevalue
property of the option is of typestring
. 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 typeTOption
ofuseSelect
hook. -
#5199
2b8d658a17a
Thanks @aliemir! - Reverted the faulty assumption on option values ofuseSelect
hook to be of typestring
. Now changed the types and the logic to reflect the correct values of options with the ability to change it via 4th generic typeTOption
ofuseSelect
hook. (Reverted PR #5160)By default
TOption
will be equal toBaseOption
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 FlatTreeItemUsing path alias causes imported types being any during build/compilation process which should be TreeMenuItem[]
-
#5201
760cfbaaa2a
Thanks @aliemir! - Exported theflattenObjectKeys
andpropertyPathToArray
helpers from@refinedev/core
package.