gluestack-ui
gluestack-ui copied to clipboard
Don't force select item value to be a string
Description
number accepted as a select item value
CodeSandbox/Snack link
No response
Steps to reproduce
type item = {
id: number
}
<SelectItem
key={item.id}
label={item.name}
value={item.id}
/>
Should be valid. Helps when using with zod validation + hook forms as suggested by the pro package.
gluestack-ui Version
1.1.3
Platform
- [X] Expo
- [ ] React Native CLI
- [ ] Next
- [ ] Web
- [ ] Android
- [ ] iOS
Other Platform
No response
Additional Information
No response
Hello @erdemkeren, The value props of the select item should accept a string. Could you please use the .toString() function. Thank you!
Bump.
Could SelectItem accept ReactNode as option label? So I can use more complex options utilizing eg. HStack/VStack
Hey @artfb , Currently this is not supported for the Select API , this will be a separate component combobox.