Skip to content
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

forwardRef should be used for all components #59

Open
bryanmylee opened this issue Feb 1, 2025 · 1 comment
Open

forwardRef should be used for all components #59

bryanmylee opened this issue Feb 1, 2025 · 1 comment

Comments

@bryanmylee
Copy link
Contributor

I'm running into issues when trying to use the primitive components with any libraries that attempt to use a ref on the component.

The main example I have right now is trying to use Tamagui's styled function to style <Select.Viewport>, <Select.ScrollUpButton>, and <Select.ScrollDownButton>. Because these components are just regular functions under the hood, Tamagui logs an error about trying to pass ref to them.

Ideally, the entire library should use forwardRef on all components, even if they are no-ops on one platform, solely to ensure that styling libraries and other functions still work properly.

@bryanmylee
Copy link
Contributor Author

I've patched the <Select> component in my local codebase to avoid this error, but perhaps a larger PR should consolidate all these cases and just upgrade everything in one shot?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant