Skip to main content
Version: 4.xx.xx

on-search-live-preview

http://localhost:3000
import { useSelect } from "@refinedev/antd";
import { Select } from "antd";

interface ICategory {
id: number;
title: string;
}

const PostCreate: React.FC = () => {
const { selectProps } = useSelect<ICategory>({
resource: "categories",
onSearch: (value) => [
{
field: "title",
operator: "contains",
value,
},
],
});

return (
<Select
placeholder="Select a category"
style={{ width: 300 }}
{...selectProps}
/>
);
};