-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
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
[useForkRef] Accept an array of refs #34383
Comments
I've already attempted to do so in #27939. |
@michaldudak It looks like it was a fun conversation. From what I understand, the discussion stopped at
I don't see how this statement is true. For example, the eslint rule says that It can't determine if the use case is valid or not, so its up to you to evaluate the case: It seems OK. |
Hey, can I try this one?! |
@oliviertassinari, I am looking at this issue and I have a question/suggestion:
When I try to put all the refs in an array, it didn't accept because some can be undefined or null, and typeScript doesn't accept that. Thanks for your attention! |
@oliviertassinari if you agree with my points in #27939, we can just merge that one. I think the usage will be even simpler than with an array. |
@michaldudak The first approach you did in #27939 seems correct. From what I understand, the eslint error was about raising the attention that the plugin can't statically determine if it's a correct or not use of the hook API this way. |
Duplicates
Latest version
Summary 💡
Instead of:
material-ui/packages/mui-base/src/ButtonUnstyled/useButton.ts
Lines 162 to 165 in 23697b9
we could have:
Examples 🌈
The signature of
Motivation 🔦
It's an idea of simplification that I notice while looking at a notification on gregberge/react-merge-refs#5.
The text was updated successfully, but these errors were encountered: