ambitious-aqua
ambitious-aqua13mo ago

useSelect with Mantine MultiSelect

I just upgraded to version 4 and I'm not sure how to use resources with MultiSelect. I'm having a type issue with useSelect and the MultiSelect component in @mantine/core. I followed the docs to create props with useSelect from @refinedev/mantine, but it appears that useSelect is only returning the SelectProps type used in the Select component, which is incompatible with the MultiSelectProps type and giving a type error. Is there a way to create props for MultiSelect or do I have to manage it manually? Example: const { selectProps } = useSelect({ resource: 'tags', }); // This is giving a type error <MultiSelect label="Tags" {...selectProps} />
2 Replies
kapa.ai
kapa.ai13mo ago
Hi @uberpwner19. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- Based on the information provided in the extracts, the useSelect hook from @refinedev/mantine is designed to work with the Select component from @mantine/core. The useSelect hook returns selectProps which are compatible with the Select component, but not with the MultiSelect component. This is likely the cause of the type error you're encountering. Unfortunately, the extracts do not provide information on how to use the useSelect hook with the MultiSelect component or if there's a similar hook specifically for MultiSelect. You may need to manage the MultiSelect component manually or check the refine documentation for more information on how to use hooks with the MultiSelect component. Here is the link to the useSelect hook documentation for your reference: useSelect Documentation (https://refine.dev/docs/api-reference/mantine/hooks/useSelect) ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai13mo ago
<@717513270571040808> kapa.ai is still learning and improving, please let us know how it did by reacting below