wet-aquaW
Refine2y ago
23 replies
wet-aqua

How can I get data from controller

import { Create } from "@refinedev/antd";

const PostCreate: React.FC = () => {
return (
<Create saveButtonProps={{
size: "small",
onClick: (e) => {
e.preventDefault();
// Your custom function here
}
}}>
<Controller
name="production_role"
control={control}
defaultValue=""
render={({ field }) => (
<>
<Typography>Production Role</Typography>
<Select {...field}>
{production_roles.map((e: any) => (
<MenuItem value={e.uuid}>{e.name}</MenuItem>
))}
</Select>
</>
)}
/>
<p>Rest of your page here</p>
</Create>
);
}; how can I get data from controller in Create component savebuttononclick function @kapa.ai
Was this page helpful?