Skip to content

Commit

Permalink
fix(android): remove the redundant PageSelectedEvent dispatch causi…
Browse files Browse the repository at this point in the history
…ng an ANR on RN 0.72 (#770)
  • Loading branch information
igorbej authored Sep 25, 2023
1 parent afdfa8b commit 51738d8
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,6 @@ class PagerViewViewManager : ViewGroupManager<NestedScrollableHost>(), RNCViewPa
val canScroll = childCount != null && childCount > 0 && selectedPage >= 0 && selectedPage < childCount
if (canScroll) {
PagerViewViewManagerImpl.setCurrentItem(view, selectedPage, scrollWithAnimation)
val reactContext = view.context as ReactContext
UIManagerHelper.getEventDispatcherForReactTag(reactContext, view.id)?.dispatchEvent(
PageSelectedEvent(view.id, selectedPage)
)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ class PagerViewViewManager : ViewGroupManager<NestedScrollableHost>() {
if (canScroll) {
val scrollWithAnimation = commandId == COMMAND_SET_PAGE
PagerViewViewManagerImpl.setCurrentItem(view, pageIndex, scrollWithAnimation)
eventDispatcher.dispatchEvent(PageSelectedEvent(root.id, pageIndex))
}
}
COMMAND_SET_SCROLL_ENABLED -> {
Expand Down

0 comments on commit 51738d8

Please sign in to comment.