API Reference
Advanced Tutorials
Comparison
FAQ
Contributing
Testing
Migration Guide
Licence
This is documentation for Refine 3.xx.xx, which is no longer actively maintained.
For up-to-date documentation, see the latest version (4.xx.xx).
Version: 3.xx.xx
on-search-live-preview
localhost:3000
Live previews only work with the latest documentation.
import { useSelect, Select } from "@pankod/refine-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}
/>
);
};