Skip to content

Commit

Permalink
fix(js): Native commands must be exported with the name 'Commands' (#818
Browse files Browse the repository at this point in the history
)

* fix(js): Native commands must be exported with the name 'Commands'

* format: prettier
  • Loading branch information
leethree authored Apr 9, 2024
1 parent 280c3a3 commit 3d089e8
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,13 @@ interface NativeCommands {
) => void;
}

export const LEGACY_PagerViewNativeCommands: NativeCommands =
codegenNativeCommands<NativeCommands>({
supportedCommands: [
'setPage',
'setPageWithoutAnimation',
'setScrollEnabledImperatively',
],
});
export const Commands: NativeCommands = codegenNativeCommands<NativeCommands>({
supportedCommands: [
'setPage',
'setPageWithoutAnimation',
'setScrollEnabledImperatively',
],
});

export default codegenNativeComponent<NativeProps>(
'LEGACY_RNCViewPager'
Expand Down
4 changes: 2 additions & 2 deletions src/PagerView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ import {
} from './utils';

import PagerViewNativeComponent, {
PagerViewNativeCommands,
Commands as PagerViewNativeCommands,
OnPageScrollEventData,
OnPageScrollStateChangedEventData,
OnPageSelectedEventData,
NativeProps,
} from './PagerViewNativeComponent/PagerViewNativeComponent';

import LEGACY_PagerViewNativeComponent, {
LEGACY_PagerViewNativeCommands,
Commands as LEGACY_PagerViewNativeCommands,
} from './LEGACY_PagerViewNativeComponent/LEGACY_PagerViewNativeComponent';

// The Fabric component for PagerView uses a work around present also in ScrollView:
Expand Down
15 changes: 7 additions & 8 deletions src/PagerViewNativeComponent/PagerViewNativeComponent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,13 @@ export interface NativeCommands {
) => void;
}

export const PagerViewNativeCommands: NativeCommands =
codegenNativeCommands<NativeCommands>({
supportedCommands: [
'setPage',
'setPageWithoutAnimation',
'setScrollEnabledImperatively',
],
});
export const Commands: NativeCommands = codegenNativeCommands<NativeCommands>({
supportedCommands: [
'setPage',
'setPageWithoutAnimation',
'setScrollEnabledImperatively',
],
});

export default codegenNativeComponent<NativeProps>(
'RNCViewPager'
Expand Down

0 comments on commit 3d089e8

Please sign in to comment.