-
Notifications
You must be signed in to change notification settings - Fork 108
allow to specify the type of ref returned by useFocusable
#188
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
base: main
Are you sure you want to change the base?
Conversation
- Originally, `E` was `extends HTMLElement = HTMLElement`, but that made the new type arg effectively requred because of `Type 'RefObject<HTMLElement>' is not assignable to type 'Ref<HTMLDivElement>'.` - `src/App.tsx` should passes type check without changes in this commit, but adding the new type arg seemed like a correct thing to do in the example
|
Hi, thank you for the PR. |
We’re trying to eliminate as much
Riiight. Removing (I don’t know if there’s an another approach of typing things like that in a way that would work in both |
Yep. Just adding the generic type and defaulting it to any should do the trick for you |
to allow passing React Native's elements NoriginMedia#188 (comment)
|
@xavi160 @predikament Could you look at this once more? 🙏 |
xavi160
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
predikament
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏻
E extends HTMLElement = HTMLElement, but that made the new type arg effectively required because ofType 'RefObject<HTMLElement>' is not assignable to type 'Ref<HTMLDivElement>'.src/App.tsxshould passes type check without changes in this PR, but adding the new type arg seemed like a correct thing to do in the example