Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/PagerView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down