No command found with name "setScrollEnabledImperatively" on iOS
Environment
System: MacOS 12.6
Node: v14.12.0 React-native: 0.67.5
Description
After upgrading the react-native-pager-view library from 6.0.2 to 6.1.4, on iOS I'm getting the following error when I try to move to the next page.

I think in order to fix it would be enough to rename the setScrollEnabled method in ReactViewPagerManager.m
@@ -63,7 +63,7 @@
[self goToPage:reactTag index:index animated:false];
}
-RCT_EXPORT_METHOD(setScrollEnabled
+RCT_EXPORT_METHOD(setScrollEnabledImperatively
: (nonnull NSNumber *)reactTag enabled
: (nonnull NSNumber *)enabled) {
BOOL isEnabled = [enabled boolValue];
Same on iOS
"react-native": "0.71.2",
"react-native-pager-view": "6.1.2"
same on 6.1.4
Hello @naquilini,
Did you re-run pod install? Because it looks like JS got out of sync with native dependency.
Hi @okwasniewski Thank for the feedback.
Yes, I did run pod install.
Looking at 6.1.4 version files you'll see that inside ReactViewPagerManager.m there is no method called "setScrollEnabledImperatively" but there is one called "setScrollEnabled"
RCT_EXPORT_METHOD(setPage
: (nonnull NSNumber *)reactTag index
: (nonnull NSNumber *)index) {
[self goToPage:reactTag index:index animated:true];
}
RCT_EXPORT_METHOD(setPageWithoutAnimation
: (nonnull NSNumber *)reactTag index
: (nonnull NSNumber *)index) {
[self goToPage:reactTag index:index animated:false];
}
RCT_EXPORT_METHOD(setScrollEnabled
: (nonnull NSNumber *)reactTag enabled
: (nonnull NSNumber *)enabled) {
BOOL isEnabled = [enabled boolValue];
[self changeScrollEnabled:reactTag enabled:isEnabled];
}
https://github.com/callstack/react-native-pager-view/blob/v6.1.4/ios/ReactViewPagerManager.m
While in PagerViewNativeComponent.ts the commands defined are
export const Commands: NativeCommands = codegenNativeCommands<NativeCommands>({
supportedCommands: [
'setPage',
'setPageWithoutAnimation',
'setScrollEnabledImperatively',
],
});
https://github.com/callstack/react-native-pager-view/blob/v6.1.4/src/PagerViewNativeComponent.ts
Cannot reproduce, closing.