-
Notifications
You must be signed in to change notification settings - Fork 245
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
expose blank event as a prop #108
Conversation
* Please note that this event isn't synced with onScroll event but works with native onDraw/layoutSubviews. Events with values > 0 are blanks. | ||
* This event is raised even when there is no visible blank with negative values for extensibility however, for most use cases check blankArea > 0 and use the value. | ||
*/ | ||
onBlankArea: BlankAreaEventHandler; |
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.
Not adding event suffix to remain consistent with event naming
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.
Thanks for doing this PR, direct events are better here, indeed 👍
@@ -25,13 +25,11 @@ class AutoLayoutViewManager: ReactViewManager() { | |||
return AutoLayoutView(context).also { it.pixelDensity = context.resources.displayMetrics.density.toDouble() } | |||
} | |||
|
|||
override fun getExportedCustomBubblingEventTypeConstants(): Map<String, Any> { | |||
override fun getExportedCustomDirectEventTypeConstants(): MutableMap<String, Any> { |
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.
why does this need to be MutableMap
?
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.
It's just what base class specifies so I can't change it
This was supposed to be very simple. Exposing blank area as a RFL prop. Once I did that I noticed the following problem
onBlankAreaEvent
from Performance wrapper is bubbled down to children leading to incorrect callback. I don't really see why we need to bubble events for these components so I changed to direct ones which are only limited to the component.ex. If we listen to this event on RFL events for the perf wrapper will also be passed to the RFL subscriber.
I've checked this both on Android/iOS
resolves #53 resolves #57