A React Framework for building internal tools, admin panels, dashboards & B2B apps with unmatched flexibility.
MIT License
Bot releases are visible (Hide)
Published by refine-bot 12 months ago
#5208 72f9f608f42
Thanks @BatuhanW! - chore: update feed URL from next to master branch.
Updated dependencies [72f9f608f42
]:
Published by refine-bot 12 months ago
72f9f608f42
, 72f9f608f42
]:
Published by refine-bot 12 months ago
#5208 72f9f608f42
Thanks @BatuhanW! - chore: update announcements source from next to master branch.
Updated dependencies [72f9f608f42
]:
Published by refine-bot 12 months ago
#5199 2b8d658a17a
Thanks @aliemir! - Updated the return type of the useSelect
hook to only include properties that actually being returned from the hook. Previously, the return type included all properties of the Select
component, which was not correct.
#5199 2b8d658a17a
Thanks @aliemir! - Now useSelect
hook accepts 4th generic type TOption
which allows you to change the type of options. 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:
In PR #5160 the type convertion of the options are tried to be resolved by string conversion. This is not correct due to the fact that the value
property of the option can be of any type. This was breaking the connection between the forms and the select inputs.
This change is reverted in the @refinedev/core
, 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.
Mantine's <Select />
component only allows values to be string
. In a case of a value
not being string
, you'll be able to manipulate the options via mapping the options before using them.
Here's how to get the proper types for the options and fix the value type issue:
import { Select } from "@mantine/core";
import { HttpError } from "@refinedev/core";
import { useSelect } from "@refinedev/mantine";
type IPost = {
id: number;
title: string;
description: string;
};
type IOption = { value: IPost["id"]; label: IPost["title"] };
const MyComponent = () => {
const { selectProps } = useSelect<IPost, HttpError, IPost, IOption>({
resource: "posts",
});
// This will result in `selectProps.data` to be of type `IOption[]`.
// <Select /> will not accept `value` as `number` so you'll have to map the options.
return (
<Select
{...selectProps}
data={selectProps.data.map((option) => ({
...option,
value: option.value.toString(),
}))}
/>
);
};
#5201 760cfbaaa2a
Thanks @aliemir! - Updated initial value setting logic in useForm
to handle nested objects properly.
Published by refine-bot 12 months ago
760cfbaaa2a
Thanks @aliemir! - Updated initial value setting logic in useForm
to handle nested objects properly.Published by refine-bot 12 months ago
#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.
Published by refine-bot 12 months ago
#5199 2b8d658a17a
Thanks @aliemir! - Now useSelect
, useRadioGroup
and useCheckboxGroup
hooks accept 4th generic type TOption
which allows you to change the type of options. 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 { 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 of useSelect
, useRadioGroup
and useCheckboxGroup
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 in useForm
Published by refine-bot 12 months ago
fc276fe53db
Thanks @BatuhanW! - chore: update README installation commandPublished by refine-bot 12 months ago
#5189 34b5741289f
Thanks @BatuhanW! - chore: bump @ant-design/pro-layout dependency to v7.17.12
.
Published by refine-bot 12 months ago
#5177 4e0f6f9a69f
Thanks @aliemir! - Fixed the issue of useList
hook requiring an empty object as prop even if there was no parameter passed to it.
#5132 f616d6ffd94
Thanks @mlukasik-dev! - fix: useSelect
's optionLabel
and optionValue
types are wrong.
#5160 9b9d5032b3a
Thanks @an-tran511! - fix: convert type of an option's value
to string
Published by refine-bot 12 months ago
be899901d0e
Thanks @aliemir! - π halloween update: devtools panel is temporarily welcoming a group of ghosts π», don't worry they are harmless. π»Published by refine-bot 12 months ago
be899901d0e
]:
Published by refine-bot 12 months ago
Published by refine-bot 12 months ago
Published by refine-bot 12 months ago
fdf12f205f2
Thanks @omeraplak! - chore: bump [email protected]Published by refine-bot 12 months ago
2bd813f62bf
Thanks @aliemir! - Add the ability to update all outdated packages with a single clickPublished by refine-bot 12 months ago
#5151 b5f93f60f1d
Thanks @aliemir! - Update @refinedev/core
version check for devtools runner to do a wider check to locate the package and its version. If the location is not found, it will start devtools without a version check.
Updated dependencies [2bd813f62bf
, 38f2a9b2e71
]:
Published by refine-bot 12 months ago
#5149 2bd813f62bf
Thanks @aliemir! - Add ability to force fetching the installed package versions
#5148 38f2a9b2e71
Thanks @aliemir! - Use node-fetch
to make feed requests to ensure older versions of Node.js are supported.
Updated dependencies [2bd813f62bf
]:
Published by refine-bot 12 months ago
2bd813f62bf
, b5f93f60f1d
, 38f2a9b2e71
]:
Published by refine-bot 12 months ago
be419eb31bc
]: