Skip to content

Commit

Permalink
feat: add prop for new container (#9772)
Browse files Browse the repository at this point in the history
Added new prop `tabsOrDrawer` for `ScreenContainer` which makes `react-native-screens` on `iOS` use new component if it is available. See software-mansion/react-native-screens#1029 for context.
  • Loading branch information
WoLewicki committed Feb 1, 2022
1 parent 0c86f76 commit 3fb2140
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/bottom-tabs/src/views/BottomTabView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ export default function BottomTabView(props: Props) {
<SafeAreaProviderCompat>
<MaybeScreenContainer
enabled={detachInactiveScreens}
hasTwoStates
style={styles.container}
>
{routes.map((route, index) => {
Expand Down
1 change: 1 addition & 0 deletions packages/bottom-tabs/src/views/ScreenFallback.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export const MaybeScreenContainer = ({
...rest
}: ViewProps & {
enabled: boolean;
hasTwoStates: boolean;
children: React.ReactNode;
}) => {
if (Screens?.screensEnabled?.()) {
Expand Down
1 change: 1 addition & 0 deletions packages/drawer/src/views/DrawerView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ function DrawerViewBase({
return (
<MaybeScreenContainer
enabled={detachInactiveScreens}
hasTwoStates
style={styles.content}
>
{state.routes.map((route, index) => {
Expand Down
1 change: 1 addition & 0 deletions packages/drawer/src/views/ScreenFallback.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export const MaybeScreenContainer = ({
...rest
}: ViewProps & {
enabled: boolean;
hasTwoStates: boolean;
children: React.ReactNode;
}) => {
if (Screens?.screensEnabled?.()) {
Expand Down

0 comments on commit 3fb2140

Please sign in to comment.