deep-jade
deep-jade3w ago

SelectProps Does not Exist

export const FirmList = React.FC = () => {
const { selectProps } = useSelect<CompanySize>({
resource: "CompanySize/GetCompanySizes",
optionLabel: "size",
optionValue: "id",
});

return (
<List>
<Select
style={{ width: 200 }}
placeholder="Company Size"
{...selectProps}
/>
</List>
);
};
SelectProps Does not Exist
2 Replies
kapa.ai
kapa.ai3w ago
Hi @CVas. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- It looks like you are encountering an issue where selectProps does not exist in your useSelect hook. Based on the provided knowledge sources, here is a correct way to use the useSelect hook with Ant Design's <Select> component. Here is an example of how to properly use the useSelect hook:
import { useSelect } from "@refinedev/antd";
import { Select } from "antd";
import { List } from "@refinedev/core"; // Assuming List is imported from refine

interface CompanySize {
id: number;
size: string;
}

export const FirmList: React.FC = () => {
const { selectProps } = useSelect<CompanySize>({
resource: "CompanySize/GetCompanySizes",
optionLabel: "size",
optionValue: "id",
});

return (
<List>
<Select
style={{ width: 200 }}
placeholder="Company Size"
{...selectProps}
/>
</List>
);
};
import { useSelect } from "@refinedev/antd";
import { Select } from "antd";
import { List } from "@refinedev/core"; // Assuming List is imported from refine

interface CompanySize {
id: number;
size: string;
}

export const FirmList: React.FC = () => {
const { selectProps } = useSelect<CompanySize>({
resource: "CompanySize/GetCompanySizes",
optionLabel: "size",
optionValue: "id",
});

return (
<List>
<Select
style={{ width: 200 }}
placeholder="Company Size"
{...selectProps}
/>
</List>
);
};
Make sure you have the correct imports and that useSelect is being used correctly. The selectProps should be destructured from the useSelect hook as shown in the example. For more details, you can refer to the useSelect documentation (https://refine.dev/docs/ui-integrations/ant-design/hooks/use-select/). If you still face issues, please ensure that you are using the latest version of the @refinedev/antd package and that your CompanySize interface matches the structure of the data returned by your resource. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai3w ago
<@334335533809664010> kapa.ai is still learning and improving, please let us know how it did by reacting below