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
crud-live-preview
localhost:3000
Live previews only work with the latest documentation.
import { Create, Select, useForm, useSelect } from "@pankod/refine-mantine";
interface ICategory {
id: number;
title: string;
}
const ProductCreate: React.FC = () => {
const { saveButtonProps, getInputProps, errors } = useForm({
initialValues: {
category: {
id: "",
},
},
});
const { selectProps } = useSelect<ICategory>({
resource: "categories",
});
return (
<Create saveButtonProps={saveButtonProps}>
<form>
<Select
mt={8}
label="Category"
placeholder="Select a category"
{...getInputProps("category.id")}
{...selectProps}
/>
</form>
</Create>
);
};