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

Expose the style prop accepted by the Pager component #1260

Merged
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
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,10 @@ Object containing the initial height and width of the screens. Passing this will

Style to apply to the view wrapping each screen. You can pass this to override some default styles such as overflow clipping:

##### `pagerStyle`

Style to apply to the pager view wrapping all the scenes.

##### `style`

Style to apply to the tab view container.
Expand Down
3 changes: 3 additions & 0 deletions src/TabView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export type Props<T extends Route> = PagerProps & {
lazy?: ((props: { route: T }) => boolean) | boolean;
lazyPreloadDistance?: number;
sceneContainerStyle?: StyleProp<ViewStyle>;
pagerStyle?: StyleProp<ViewStyle>;
style?: StyleProp<ViewStyle>;
};

Expand All @@ -46,6 +47,7 @@ export default function TabView<T extends Route>({
renderLazyPlaceholder = () => null,
renderTabBar = (props) => <TabBar {...props} />,
sceneContainerStyle,
pagerStyle,
style,
swipeEnabled = true,
tabBarPosition = 'top',
Expand Down Expand Up @@ -84,6 +86,7 @@ export default function TabView<T extends Route>({
onSwipeStart={onSwipeStart}
onSwipeEnd={onSwipeEnd}
onIndexChange={jumpToIndex}
style={pagerStyle}
>
{({ position, render, addEnterListener, jumpTo }) => {
// All of the props here must not change between re-renders
Expand Down