-
-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Web and Native discrepancies #26
Comments
I agree with this, it seems an unnecessary complication. |
I think this can be addressed by matching the Radix API. Radix is the standard. Whether or not it's more convenient to receive the entire option back, anyone who is trying to migrate from Radix will have an easier time if the API exactly matches. onValueChange's signature ought to be |
@mrzachnugent i would love to submit a PR to do this with your blessing |
@ianmartorell PR are more than welcome! If I remember correctly, this added complexity is to allow the native and web components to have as much freedom. I think the main issue was with getting the child of If you could unify the API while maintaining the flexibility of having something like the following snippet, that would be awesome. const SelectItem = React.forwardRef(({ children, className, ...props }, forwardedRef) => {
return (
<Select.Item className={classnames('SelectItem', className)} {...props} ref={forwardedRef}>
<Select.ItemText>{children}</Select.ItemText>
<Select.ItemIndicator className="SelectItemIndicator">
<CheckIcon />
</Select.ItemIndicator>
</Select.Item>
);
});
|
Why is it that
Select
'sonValueChange
behaves differently in web and native? I see that Radix only passes the value to the callback function but it's a bit confusing that the value gets passed as the label as well toonValueChange
. There's no mention of it in the documentation either, I thought it was a bug.rn-primitives/packages/select/src/select.web.tsx
Lines 35 to 38 in 5a5f215
Would you consider unifying the API by either finding the label in the web version to pass it to the callback, or changing the API of the native primitive?
Is having parity between platforms a goal of this project?
Thank you!
The text was updated successfully, but these errors were encountered: