diff --git a/src/PagerView.tsx b/src/PagerView.tsx index 9122b992..b8b1d5c2 100644 --- a/src/PagerView.tsx +++ b/src/PagerView.tsx @@ -14,6 +14,17 @@ import PagerViewView, { Commands as PagerViewCommands, } from './PagerViewNativeComponent'; +// The Fabric component for PagerView uses a work around present also in ScrollView: +// https://github.com/callstack/react-native-pager-view/blob/master/ios/Fabric/RNCPagerViewComponentView.mm#L362-L368 +// That workaround works only if we add these lines in to make sure that the RCTEventEmitter is registered properly +// in the JS callable modules. +// NOTE: This is a workaround as we would like to get rid of these lines below. But for the time being, as the cut date for +// 0.74 approaches, we need to keep these lines. +// As soon as we figure out how to move forward, we will provide guidance and/or submit a PR to fix this. +if (Platform.OS === 'ios') { + require('react-native/Libraries/Renderer/shims/ReactNative'); // Force side effects to prevent T55744311 +} + /** * Container that allows to flip left and right between child views. Each * child view of the `PagerView` will be treated as a separate page