Skip to content

Commit 3d089e8

Browse files
authored
fix(js): Native commands must be exported with the name 'Commands' (#818)
* fix(js): Native commands must be exported with the name 'Commands' * format: prettier
1 parent 280c3a3 commit 3d089e8

File tree

3 files changed

+16
-18
lines changed

3 files changed

+16
-18
lines changed

src/LEGACY_PagerViewNativeComponent/LEGACY_PagerViewNativeComponent.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,13 @@ interface NativeCommands {
6767
) => void;
6868
}
6969

70-
export const LEGACY_PagerViewNativeCommands: NativeCommands =
71-
codegenNativeCommands<NativeCommands>({
72-
supportedCommands: [
73-
'setPage',
74-
'setPageWithoutAnimation',
75-
'setScrollEnabledImperatively',
76-
],
77-
});
70+
export const Commands: NativeCommands = codegenNativeCommands<NativeCommands>({
71+
supportedCommands: [
72+
'setPage',
73+
'setPageWithoutAnimation',
74+
'setScrollEnabledImperatively',
75+
],
76+
});
7877

7978
export default codegenNativeComponent<NativeProps>(
8079
'LEGACY_RNCViewPager'

src/PagerView.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ import {
99
} from './utils';
1010

1111
import PagerViewNativeComponent, {
12-
PagerViewNativeCommands,
12+
Commands as PagerViewNativeCommands,
1313
OnPageScrollEventData,
1414
OnPageScrollStateChangedEventData,
1515
OnPageSelectedEventData,
1616
NativeProps,
1717
} from './PagerViewNativeComponent/PagerViewNativeComponent';
1818

1919
import LEGACY_PagerViewNativeComponent, {
20-
LEGACY_PagerViewNativeCommands,
20+
Commands as LEGACY_PagerViewNativeCommands,
2121
} from './LEGACY_PagerViewNativeComponent/LEGACY_PagerViewNativeComponent';
2222

2323
// The Fabric component for PagerView uses a work around present also in ScrollView:

src/PagerViewNativeComponent/PagerViewNativeComponent.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,13 @@ export interface NativeCommands {
5656
) => void;
5757
}
5858

59-
export const PagerViewNativeCommands: NativeCommands =
60-
codegenNativeCommands<NativeCommands>({
61-
supportedCommands: [
62-
'setPage',
63-
'setPageWithoutAnimation',
64-
'setScrollEnabledImperatively',
65-
],
66-
});
59+
export const Commands: NativeCommands = codegenNativeCommands<NativeCommands>({
60+
supportedCommands: [
61+
'setPage',
62+
'setPageWithoutAnimation',
63+
'setScrollEnabledImperatively',
64+
],
65+
});
6766

6867
export default codegenNativeComponent<NativeProps>(
6968
'RNCViewPager'

0 commit comments

Comments
 (0)