Patch Changes
-
#5199
2b8d658a17a
Thanks @aliemir! - NowuseSelect
,useRadioGroup
anduseCheckboxGroup
hooks accept 4th generic typeTOption
which allows you to change the type of options. By defaultTOption
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 { useSelect } from "@refinedev/antd"; import { HttpError } 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", });
-
#5199
2b8d658a17a
Thanks @aliemir! - Updated return types ofuseSelect
,useRadioGroup
anduseCheckboxGroup
hooks to only include properties that actually being returned from the hook. Previously, the return types included all properties of the respective components, which was not correct. -
#5201
760cfbaaa2a
Thanks @aliemir! - Handle nested server side validation errors properly inuseForm