-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
fix(Overlay): Fix types and overlay example #5275
Conversation
@@ -17,9 +17,13 @@ export interface OverlayInjectedProps { | |||
style: React.CSSProperties; | |||
'aria-labelledby'?: string; | |||
|
|||
arrowProps: { ref: any; style: object }; | |||
arrowProps: { | |||
ref: React.RefCallback<HTMLElement>; |
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.
are we explicitly expecting this to be a ref callback? why can't it just be typed as any valid ref?
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.
This is typed to match that of upstream react-overlays
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.
okay well I don't understand why the types for react-overlays is that way either 😛 it should be allowed to pass in any valid refs for that feature.
But this is something we'd have to fix in react-overlays first so for now it makes sense for them to be the same type.
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.
Agreed. I was wondering about the ref typing as well, but didn't have enough time for a deep dive into RO today.
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.
Double checked RO and the type is correct. It always passes a callback ref.
Resolves #4717