Skip to content
This repository was archived by the owner on Nov 27, 2022. It is now read-only.

Commit a36ed15

Browse files
committed
fix: add 'bounces' prop type only to PagerScroll
1 parent d561e0d commit a36ed15

File tree

5 files changed

+10
-6
lines changed

5 files changed

+10
-6
lines changed

example/src/TopBarIconExample.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export default class TopBarIconExample extends React.Component<*, State> {
6969
renderScene={this._renderScene}
7070
renderTabBar={this._renderTabBar}
7171
onIndexChange={this._handleIndexChange}
72-
bounces // only iOS
72+
bounces
7373
/>
7474
);
7575
}

example/src/TopBarTextExample.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export default class TopBarTextExample extends React.Component<*, State> {
7373
renderTabBar={this._renderTabBar}
7474
onIndexChange={this._handleIndexChange}
7575
initialLayout={initialLayout}
76-
bounces // only iOS
76+
bounces
7777
/>
7878
);
7979
}

src/PagerScroll.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/* @flow */
22

33
import * as React from 'react';
4+
import PropTypes from 'prop-types';
45
import { View, ScrollView, StyleSheet } from 'react-native';
56
import { PagerRendererPropType } from './PropTypes';
67
import type { PagerRendererProps } from './TypeDefinitions';
@@ -22,13 +23,18 @@ type State = {|
2223
initialOffset: {| x: number, y: number |},
2324
|};
2425

25-
type Props<T> = PagerRendererProps<T>;
26+
type Props<T> = PagerRendererProps<T> & {
27+
bounces: boolean,
28+
};
2629

2730
export default class PagerScroll<T: *> extends React.Component<
2831
Props<T>,
2932
State
3033
> {
31-
static propTypes = PagerRendererPropType;
34+
static propTypes = {
35+
...PagerRendererPropType,
36+
bounces: PropTypes.bool.isRequired,
37+
};
3238

3339
static defaultProps = {
3440
canJumpToTab: () => true,

src/PropTypes.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ export const PagerRendererPropType = {
4040
jumpTo: PropTypes.func.isRequired,
4141
animationEnabled: PropTypes.bool,
4242
swipeEnabled: PropTypes.bool,
43-
bounces: PropTypes.bool.isRequired,
4443
useNativeDriver: PropTypes.bool,
4544
onSwipeStart: PropTypes.func,
4645
onSwipeEnd: PropTypes.func,

src/TypeDefinitions.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ export type PagerRendererProps<T> = PagerCommonProps<T> & {
4646
export type PagerCommonProps<T> = {
4747
animationEnabled?: boolean,
4848
swipeEnabled?: boolean,
49-
bounces?: boolean,
5049
onSwipeStart?: () => mixed,
5150
onSwipeEnd?: () => mixed,
5251
onAnimationEnd?: () => mixed,

0 commit comments

Comments
 (0)