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

Commit

Permalink
feat: expose the style prop accepted by the Pager component (#1260)
Browse files Browse the repository at this point in the history
  • Loading branch information
simonbuerger authored and szymonrybczak committed Sep 24, 2022
1 parent 13c2037 commit 07ee1b0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
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 @@ -86,6 +88,7 @@ export default function TabView<T extends Route>({
onSwipeEnd={onSwipeEnd}
onIndexChange={jumpToIndex}
animationEnabled={animationEnabled}
style={pagerStyle}
>
{({ position, render, addEnterListener, jumpTo }) => {
// All of the props here must not change between re-renders
Expand Down

0 comments on commit 07ee1b0

Please sign in to comment.