Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ However, there are few more additional props:

|Prop|Description|Platform|
|-|:-----:|:---:|
|`style: object`|Style to apply to ViewPager|both
|`pageMargin: number`|Blank space to be shown between pages|both
|`orientation: Orientation`|Set `horizontal` or `vertical` scrolling orientation (it does **not** work dynamically)|both
|`transitionStyle: TransitionStyle`|Use `scroll` or `curl` to change transition style (it does **not** work dynamically)|iOS
Expand Down
6 changes: 4 additions & 2 deletions src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import { Keyboard } from 'react-native';
import { Keyboard, StyleProp } from 'react-native';
import ViewPager from '@react-native-community/viewpager';
import Animated from 'react-native-reanimated';

Expand Down Expand Up @@ -29,6 +29,7 @@ type Props<T extends Route> = PagerCommonProps & {
jumpTo: (key: string) => void;
}
) => React.ReactNode;
style?: StyleProp<ViewStyle>;
orientation?: 'vertical' | 'horizontal';
transitionStyle?: 'scroll' | 'curl';
showPageIndicator?: boolean;
Expand Down Expand Up @@ -148,6 +149,7 @@ export default class ViewPagerBackend<T extends Route> extends React.Component<

render() {
const {
style,
keyboardDismissMode,
swipeEnabled,
children,
Expand All @@ -166,7 +168,7 @@ export default class ViewPagerBackend<T extends Route> extends React.Component<
<AnimatedViewPager
ref={this.ref}
lazy={false}
style={{ flex: 1 }}
style={{ flex: 1, ...style }}
initialPage={this.props.navigationState.index}
keyboardDismissMode={
// ViewPager does not accept auto mode
Expand Down