Compare commits

...

8 Commits

Author SHA1 Message Date
Satyajit Sahoo
5afc82b11a chore: publish
- react-navigation-animated-switch@0.5.5
 - react-navigation-drawer@2.4.6
 - react-navigation-material-bottom-tabs@2.2.5
 - @react-navigation/native@3.7.6
 - react-navigation@4.3.2
 - react-navigation-stack@2.3.4
 - react-navigation-tabs@2.8.6
2020-03-20 14:41:05 +01:00
Satyajit Sahoo
80c8c9d1de fix: don't mix import and module.exports. closes #7660 2020-03-20 14:28:24 +01:00
Satyajit Sahoo
fd7c5ca9b2 chore: publish
- react-navigation-stack@2.3.3
2020-03-20 11:49:37 +01:00
Satyajit Sahoo
72bbebc80e chore: sync latest stack 2020-03-20 11:40:21 +01:00
Satyajit Sahoo
915861e601 chore: publish
- react-navigation-stack@2.3.2
2020-03-19 20:12:07 +01:00
Satyajit Sahoo
8152ae1212 chore: sync latest stack 2020-03-19 20:11:34 +01:00
Satyajit Sahoo
79125bfab9 chore: publish
- react-navigation-drawer@2.4.5
 - react-navigation-tabs@2.8.5
2020-03-19 16:44:44 +01:00
Satyajit Sahoo
44c390075f fix: don't use react-native-screens on web
seems `react-native-screens` doesn't handle active screens properly and shows a blank page
 instead on web when a number is specified in the `active` prop.

closes #7485
2020-03-19 16:43:28 +01:00
23 changed files with 214 additions and 85 deletions

View File

@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [0.5.5](https://github.com/react-navigation/react-navigation/compare/react-navigation-animated-switch@0.5.4...react-navigation-animated-switch@0.5.5) (2020-03-20)
**Note:** Version bump only for package react-navigation-animated-switch
## [0.5.4](https://github.com/react-navigation/react-navigation/compare/react-navigation-animated-switch@0.5.3...react-navigation-animated-switch@0.5.4) (2020-03-16)
**Note:** Version bump only for package react-navigation-animated-switch

View File

@@ -1,6 +1,6 @@
{
"name": "react-navigation-animated-switch",
"version": "0.5.4",
"version": "0.5.5",
"description": "Animated switch for React Navigation",
"main": "lib/commonjs/index.js",
"react-native": "lib/module/index.js",
@@ -28,7 +28,7 @@
"react": "~16.9.0",
"react-native": "~0.61.5",
"react-native-reanimated": "~1.7.0",
"react-navigation": "^4.3.1",
"react-navigation": "^4.3.2",
"typescript": "~3.7.5"
},
"peerDependencies": {

View File

@@ -3,6 +3,25 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [2.4.6](https://github.com/react-navigation/drawer/compare/react-navigation-drawer@2.4.5...react-navigation-drawer@2.4.6) (2020-03-20)
**Note:** Version bump only for package react-navigation-drawer
## [2.4.5](https://github.com/react-navigation/drawer/compare/react-navigation-drawer@2.4.4...react-navigation-drawer@2.4.5) (2020-03-19)
### Bug Fixes
* don't use react-native-screens on web ([44c3900](https://github.com/react-navigation/drawer/commit/44c390075f7b76664e09fd9a1a7926645133ebec)), closes [#7485](https://github.com/react-navigation/drawer/issues/7485)
## [2.4.4](https://github.com/react-navigation/drawer/compare/react-navigation-drawer@2.4.3...react-navigation-drawer@2.4.4) (2020-03-16)
**Note:** Version bump only for package react-navigation-drawer

View File

@@ -1,6 +1,6 @@
{
"name": "react-navigation-drawer",
"version": "2.4.4",
"version": "2.4.6",
"description": "Drawer navigator component for React Navigation",
"main": "lib/commonjs/index.js",
"react-native": "lib/module/index.js",
@@ -49,7 +49,7 @@
"react-native-reanimated": "^1.2.0",
"react-native-screens": "^2.3.0",
"react-native-testing-library": "^1.12.0",
"react-navigation": "^4.3.1",
"react-navigation": "^4.3.2",
"typescript": "~3.7.5"
},
"peerDependencies": {

View File

@@ -1,5 +1,3 @@
/* @flow */
import * as React from 'react';
import { Platform, StyleSheet, View } from 'react-native';
import { Screen, screensEnabled } from 'react-native-screens';
@@ -10,21 +8,29 @@ type Props = {
style?: any;
};
const FAR_FAR_AWAY = 3000; // this should be big enough to move the whole view out of its container
const FAR_FAR_AWAY = 30000; // this should be big enough to move the whole view out of its container
export default class ResourceSavingScene extends React.Component<Props> {
render() {
if (screensEnabled?.()) {
// react-native-screens is buggy on web
if (screensEnabled?.() && Platform.OS !== 'web') {
const { isVisible, ...rest } = this.props;
// @ts-ignore
return <Screen active={isVisible ? 1 : 0} {...rest} />;
}
const { isVisible, children, style, ...rest } = this.props;
return (
<View
style={[styles.container, style]}
style={[
styles.container,
Platform.OS === 'web'
? { display: isVisible ? 'flex' : 'none' }
: null,
style,
]}
collapsable={false}
removeClippedSubviews={
// On iOS, set removeClippedSubviews to true only when not focused

View File

@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [2.2.5](https://github.com/react-navigation/react-navigation-material-bottom-tabs/compare/react-navigation-material-bottom-tabs@2.2.4...react-navigation-material-bottom-tabs@2.2.5) (2020-03-20)
**Note:** Version bump only for package react-navigation-material-bottom-tabs
## [2.2.4](https://github.com/react-navigation/react-navigation-material-bottom-tabs/compare/react-navigation-material-bottom-tabs@2.2.3...react-navigation-material-bottom-tabs@2.2.4) (2020-03-16)
**Note:** Version bump only for package react-navigation-material-bottom-tabs

View File

@@ -1,6 +1,6 @@
{
"name": "react-navigation-material-bottom-tabs",
"version": "2.2.4",
"version": "2.2.5",
"description": "Material Bottom Tab Navigation component for React Navigation",
"main": "lib/commonjs/index.js",
"module": "lib/module/index.js",
@@ -48,7 +48,7 @@
"react-native-gesture-handler": "^1.6.0",
"react-native-paper": "^3.1.1",
"react-native-reanimated": "^1.2.0",
"react-navigation": "^4.3.1",
"react-navigation": "^4.3.2",
"typescript": "~3.7.5"
},
"peerDependencies": {

View File

@@ -3,6 +3,17 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [3.7.6](https://github.com/react-navigation/react-navigation-native/compare/@react-navigation/native@3.7.5...@react-navigation/native@3.7.6) (2020-03-20)
### Bug Fixes
* don't mix import and module.exports. closes [#7660](https://github.com/react-navigation/react-navigation-native/issues/7660) ([80c8c9d](https://github.com/react-navigation/react-navigation-native/commit/80c8c9d1dead57eab3b977a1eebf1e9f5f35cd1a))
## [3.7.5](https://github.com/react-navigation/react-navigation-native/compare/@react-navigation/native@3.7.4...@react-navigation/native@3.7.5) (2020-03-16)

View File

@@ -1,6 +1,6 @@
{
"name": "@react-navigation/native",
"version": "3.7.5",
"version": "3.7.6",
"description": "React Native support for React Navigation",
"main": "lib/commonjs/index.js",
"react-native": "lib/module/index.js",

View File

@@ -68,9 +68,8 @@ const WrappedSectionList = React.forwardRef((props, ref) => (
/>
));
// eslint-disable-next-line import/no-commonjs
module.exports = {
ScrollView: WrappedScrollView,
FlatList: WrappedFlatList,
SectionList: WrappedSectionList,
export {
WrappedScrollView as ScrollView,
WrappedFlatList as FlatList,
WrappedSectionList as SectionList,
};

View File

@@ -19,7 +19,7 @@ if (process.env.NODE_ENV !== 'production') {
};
}
function invariant(condition, format, a, b, c, d, e, f) {
export default function invariant(condition, format, a, b, c, d, e, f) {
validateFormat(format);
if (!condition) {
@@ -43,6 +43,3 @@ function invariant(condition, format, a, b, c, d, e, f) {
throw error;
}
}
// eslint-disable-next-line import/no-commonjs
module.exports = invariant;

View File

@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [4.3.2](https://github.com/react-navigation/react-navigation/compare/react-navigation@4.3.1...react-navigation@4.3.2) (2020-03-20)
**Note:** Version bump only for package react-navigation
## [4.3.1](https://github.com/react-navigation/react-navigation/compare/react-navigation@4.3.0...react-navigation@4.3.1) (2020-03-16)
**Note:** Version bump only for package react-navigation

View File

@@ -1,6 +1,6 @@
{
"name": "react-navigation",
"version": "4.3.1",
"version": "4.3.2",
"description": "Routing and navigation for your React Native apps",
"main": "src/index.js",
"types": "typescript/react-navigation.d.ts",
@@ -25,7 +25,7 @@
},
"dependencies": {
"@react-navigation/core": "^3.7.0",
"@react-navigation/native": "^3.7.5"
"@react-navigation/native": "^3.7.6"
},
"devDependencies": {
"@types/react": "^16.9.23",

View File

@@ -3,6 +3,30 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [2.3.4](https://github.com/react-navigation/react-navigation-stack/compare/react-navigation-stack@2.3.3...react-navigation-stack@2.3.4) (2020-03-20)
**Note:** Version bump only for package react-navigation-stack
## [2.3.3](https://github.com/react-navigation/react-navigation-stack/compare/react-navigation-stack@2.3.2...react-navigation-stack@2.3.3) (2020-03-20)
**Note:** Version bump only for package react-navigation-stack
## [2.3.2](https://github.com/react-navigation/react-navigation-stack/compare/react-navigation-stack@2.3.1...react-navigation-stack@2.3.2) (2020-03-19)
**Note:** Version bump only for package react-navigation-stack
## [2.3.1](https://github.com/react-navigation/react-navigation-stack/compare/react-navigation-stack@2.3.0...react-navigation-stack@2.3.1) (2020-03-16)
**Note:** Version bump only for package react-navigation-stack

View File

@@ -1,6 +1,6 @@
{
"name": "react-navigation-stack",
"version": "2.3.1",
"version": "2.3.4",
"description": "Stack navigator component for React Navigation",
"main": "lib/commonjs/index.js",
"module": "lib/module/index.js",
@@ -45,7 +45,7 @@
"devDependencies": {
"@react-native-community/bob": "^0.10.0",
"@react-native-community/masked-view": "^0.1.7",
"@react-navigation/stack": "^5.2.0",
"@react-navigation/stack": "^5.2.3",
"@types/color": "^3.0.1",
"@types/react": "^16.9.23",
"@types/react-native": "^0.61.22",
@@ -56,7 +56,7 @@
"react-native-gesture-handler": "^1.6.0",
"react-native-safe-area-context": "^0.7.3",
"react-native-screens": "^2.3.0",
"react-navigation": "^4.3.1",
"react-navigation": "^4.3.2",
"react-test-renderer": "~16.9.0",
"typescript": "~3.7.5"
},

View File

@@ -1,6 +1,6 @@
diff -Naur ../../node_modules/@react-navigation/stack/src/index.tsx src/vendor/index.tsx
--- ../../node_modules/@react-navigation/stack/src/index.tsx 2020-03-16 14:39:49.000000000 +0100
+++ src/vendor/index.tsx 2020-03-16 14:41:12.000000000 +0100
--- ../../node_modules/@react-navigation/stack/src/index.tsx 2020-03-19 20:09:01.000000000 +0100
+++ src/vendor/index.tsx 2020-03-19 20:09:16.000000000 +0100
@@ -3,11 +3,6 @@
import * as TransitionSpecs from './TransitionConfigs/TransitionSpecs';
import * as TransitionPresets from './TransitionConfigs/TransitionPresets';
@@ -28,7 +28,7 @@ diff -Naur ../../node_modules/@react-navigation/stack/src/index.tsx src/vendor/i
StackHeaderTitleProps,
StackCardInterpolatedStyle,
diff -Naur ../../node_modules/@react-navigation/stack/src/navigators/createStackNavigator.tsx src/vendor/navigators/createStackNavigator.tsx
--- ../../node_modules/@react-navigation/stack/src/navigators/createStackNavigator.tsx 2020-03-16 14:39:49.000000000 +0100
--- ../../node_modules/@react-navigation/stack/src/navigators/createStackNavigator.tsx 2020-03-19 20:09:01.000000000 +0100
+++ src/vendor/navigators/createStackNavigator.tsx 1970-01-01 01:00:00.000000000 +0100
@@ -1,81 +0,0 @@
-import * as React from 'react';
@@ -113,8 +113,8 @@ diff -Naur ../../node_modules/@react-navigation/stack/src/navigators/createStack
- typeof StackNavigator
->(StackNavigator);
diff -Naur ../../node_modules/@react-navigation/stack/src/types.tsx src/vendor/types.tsx
--- ../../node_modules/@react-navigation/stack/src/types.tsx 2020-03-16 14:39:49.000000000 +0100
+++ src/vendor/types.tsx 2020-03-16 14:47:01.000000000 +0100
--- ../../node_modules/@react-navigation/stack/src/types.tsx 2020-03-19 20:09:01.000000000 +0100
+++ src/vendor/types.tsx 2020-03-19 20:09:16.000000000 +0100
@@ -8,14 +8,28 @@
} from 'react-native';
import { EdgeInsets } from 'react-native-safe-area-context';
@@ -240,8 +240,8 @@ diff -Naur ../../node_modules/@react-navigation/stack/src/types.tsx src/vendor/t
export type StackNavigationConfig = {
diff -Naur ../../node_modules/@react-navigation/stack/src/views/Header/Header.tsx src/vendor/views/Header/Header.tsx
--- ../../node_modules/@react-navigation/stack/src/views/Header/Header.tsx 2020-03-16 14:39:49.000000000 +0100
+++ src/vendor/views/Header/Header.tsx 2020-03-16 14:41:16.000000000 +0100
--- ../../node_modules/@react-navigation/stack/src/views/Header/Header.tsx 2020-03-19 20:09:01.000000000 +0100
+++ src/vendor/views/Header/Header.tsx 2020-03-19 20:09:16.000000000 +0100
@@ -1,12 +1,14 @@
import * as React from 'react';
-import { StackActions } from '@react-navigation/native';
@@ -321,8 +321,8 @@ diff -Naur ../../node_modules/@react-navigation/stack/src/views/Header/Header.ts
+
+export default Header;
diff -Naur ../../node_modules/@react-navigation/stack/src/views/Header/HeaderBackButton.tsx src/vendor/views/Header/HeaderBackButton.tsx
--- ../../node_modules/@react-navigation/stack/src/views/Header/HeaderBackButton.tsx 2020-03-16 14:39:49.000000000 +0100
+++ src/vendor/views/Header/HeaderBackButton.tsx 2020-03-16 14:41:16.000000000 +0100
--- ../../node_modules/@react-navigation/stack/src/views/Header/HeaderBackButton.tsx 2020-03-19 20:09:01.000000000 +0100
+++ src/vendor/views/Header/HeaderBackButton.tsx 2020-03-19 20:09:16.000000000 +0100
@@ -8,9 +8,9 @@
StyleSheet,
LayoutChangeEvent,
@@ -335,8 +335,8 @@ diff -Naur ../../node_modules/@react-navigation/stack/src/views/Header/HeaderBac
type Props = StackHeaderLeftButtonProps;
diff -Naur ../../node_modules/@react-navigation/stack/src/views/Header/HeaderBackground.tsx src/vendor/views/Header/HeaderBackground.tsx
--- ../../node_modules/@react-navigation/stack/src/views/Header/HeaderBackground.tsx 2020-03-16 14:39:49.000000000 +0100
+++ src/vendor/views/Header/HeaderBackground.tsx 2020-03-16 14:41:16.000000000 +0100
--- ../../node_modules/@react-navigation/stack/src/views/Header/HeaderBackground.tsx 2020-03-19 20:09:01.000000000 +0100
+++ src/vendor/views/Header/HeaderBackground.tsx 2020-03-19 20:09:16.000000000 +0100
@@ -1,6 +1,6 @@
import * as React from 'react';
import { Animated, StyleSheet, Platform, ViewProps } from 'react-native';
@@ -346,8 +346,8 @@ diff -Naur ../../node_modules/@react-navigation/stack/src/views/Header/HeaderBac
type Props = ViewProps & {
children?: React.ReactNode;
diff -Naur ../../node_modules/@react-navigation/stack/src/views/Header/HeaderContainer.tsx src/vendor/views/Header/HeaderContainer.tsx
--- ../../node_modules/@react-navigation/stack/src/views/Header/HeaderContainer.tsx 2020-03-16 14:39:49.000000000 +0100
+++ src/vendor/views/Header/HeaderContainer.tsx 2020-03-16 14:41:16.000000000 +0100
--- ../../node_modules/@react-navigation/stack/src/views/Header/HeaderContainer.tsx 2020-03-19 20:09:01.000000000 +0100
+++ src/vendor/views/Header/HeaderContainer.tsx 2020-03-19 20:09:16.000000000 +0100
@@ -1,11 +1,6 @@
import * as React from 'react';
import { View, StyleSheet, StyleProp, ViewStyle } from 'react-native';
@@ -399,8 +399,8 @@ diff -Naur ../../node_modules/@react-navigation/stack/src/views/Header/HeaderCon
);
})}
diff -Naur ../../node_modules/@react-navigation/stack/src/views/Header/HeaderSegment.tsx src/vendor/views/Header/HeaderSegment.tsx
--- ../../node_modules/@react-navigation/stack/src/views/Header/HeaderSegment.tsx 2020-03-16 14:39:49.000000000 +0100
+++ src/vendor/views/Header/HeaderSegment.tsx 2020-03-16 14:41:16.000000000 +0100
--- ../../node_modules/@react-navigation/stack/src/views/Header/HeaderSegment.tsx 2020-03-19 20:09:01.000000000 +0100
+++ src/vendor/views/Header/HeaderSegment.tsx 2020-03-19 20:09:16.000000000 +0100
@@ -8,7 +8,7 @@
ViewStyle,
} from 'react-native';
@@ -420,8 +420,8 @@ diff -Naur ../../node_modules/@react-navigation/stack/src/views/Header/HeaderSeg
};
diff -Naur ../../node_modules/@react-navigation/stack/src/views/Header/HeaderTitle.tsx src/vendor/views/Header/HeaderTitle.tsx
--- ../../node_modules/@react-navigation/stack/src/views/Header/HeaderTitle.tsx 2020-03-16 14:39:49.000000000 +0100
+++ src/vendor/views/Header/HeaderTitle.tsx 2020-03-16 14:43:23.000000000 +0100
--- ../../node_modules/@react-navigation/stack/src/views/Header/HeaderTitle.tsx 2020-03-19 20:09:01.000000000 +0100
+++ src/vendor/views/Header/HeaderTitle.tsx 2020-03-19 20:09:16.000000000 +0100
@@ -1,6 +1,6 @@
import * as React from 'react';
import { Animated, StyleSheet, Platform } from 'react-native';
@@ -431,8 +431,8 @@ diff -Naur ../../node_modules/@react-navigation/stack/src/views/Header/HeaderTit
type Props = React.ComponentProps<typeof Animated.Text> & {
tintColor?: string;
diff -Naur ../../node_modules/@react-navigation/stack/src/views/Stack/Card.tsx src/vendor/views/Stack/Card.tsx
--- ../../node_modules/@react-navigation/stack/src/views/Stack/Card.tsx 2020-03-16 14:39:49.000000000 +0100
+++ src/vendor/views/Stack/Card.tsx 2020-03-16 14:41:16.000000000 +0100
--- ../../node_modules/@react-navigation/stack/src/views/Stack/Card.tsx 2020-03-19 20:09:01.000000000 +0100
+++ src/vendor/views/Stack/Card.tsx 2020-03-19 20:09:16.000000000 +0100
@@ -138,7 +138,7 @@
private interactionHandle: number | undefined;
@@ -443,8 +443,8 @@ diff -Naur ../../node_modules/@react-navigation/stack/src/views/Stack/Card.tsx s
private animate = ({
closing,
diff -Naur ../../node_modules/@react-navigation/stack/src/views/Stack/CardContainer.tsx src/vendor/views/Stack/CardContainer.tsx
--- ../../node_modules/@react-navigation/stack/src/views/Stack/CardContainer.tsx 2020-03-16 14:39:49.000000000 +0100
+++ src/vendor/views/Stack/CardContainer.tsx 2020-03-16 14:41:16.000000000 +0100
--- ../../node_modules/@react-navigation/stack/src/views/Stack/CardContainer.tsx 2020-03-19 20:09:01.000000000 +0100
+++ src/vendor/views/Stack/CardContainer.tsx 2020-03-19 20:09:16.000000000 +0100
@@ -1,10 +1,16 @@
import * as React from 'react';
import { Animated, View, StyleSheet, StyleProp, ViewStyle } from 'react-native';
@@ -500,8 +500,8 @@ diff -Naur ../../node_modules/@react-navigation/stack/src/views/Stack/CardContai
>
<View style={styles.container}>
diff -Naur ../../node_modules/@react-navigation/stack/src/views/Stack/CardStack.tsx src/vendor/views/Stack/CardStack.tsx
--- ../../node_modules/@react-navigation/stack/src/views/Stack/CardStack.tsx 2020-03-16 14:39:49.000000000 +0100
+++ src/vendor/views/Stack/CardStack.tsx 2020-03-16 14:41:16.000000000 +0100
--- ../../node_modules/@react-navigation/stack/src/views/Stack/CardStack.tsx 2020-03-19 20:09:01.000000000 +0100
+++ src/vendor/views/Stack/CardStack.tsx 2020-03-19 20:09:16.000000000 +0100
@@ -9,9 +9,8 @@
ViewProps,
} from 'react-native';
@@ -529,7 +529,7 @@ diff -Naur ../../node_modules/@react-navigation/stack/src/views/Stack/CardStack.
onTransitionStart: (
props: { route: Route<string> },
closing: boolean
@@ -371,6 +372,7 @@
@@ -383,6 +384,7 @@
renderHeader,
renderScene,
headerMode,
@@ -537,7 +537,7 @@ diff -Naur ../../node_modules/@react-navigation/stack/src/views/Stack/CardStack.
onTransitionStart,
onTransitionEnd,
onPageChangeStart,
@@ -548,6 +550,7 @@
@@ -560,6 +562,7 @@
renderScene={renderScene}
onOpenRoute={onOpenRoute}
onCloseRoute={onCloseRoute}
@@ -546,8 +546,8 @@ diff -Naur ../../node_modules/@react-navigation/stack/src/views/Stack/CardStack.
onTransitionEnd={onTransitionEnd}
gestureEnabled={index !== 0 && getGesturesEnabled({ route })}
diff -Naur ../../node_modules/@react-navigation/stack/src/views/Stack/StackView.tsx src/vendor/views/Stack/StackView.tsx
--- ../../node_modules/@react-navigation/stack/src/views/Stack/StackView.tsx 2020-03-16 14:39:49.000000000 +0100
+++ src/vendor/views/Stack/StackView.tsx 2020-03-16 15:41:41.000000000 +0100
--- ../../node_modules/@react-navigation/stack/src/views/Stack/StackView.tsx 2020-03-19 20:09:01.000000000 +0100
+++ src/vendor/views/Stack/StackView.tsx 2020-03-19 20:09:16.000000000 +0100
@@ -4,9 +4,9 @@
import { GestureHandlerRootView } from 'react-native-gesture-handler';
import {

View File

@@ -1,5 +1,5 @@
import * as React from 'react';
import { TextInput, Keyboard } from 'react-native';
import { TextInput } from 'react-native';
type Props = {
enabled: boolean;
@@ -54,7 +54,11 @@ export default class KeyboardManager extends React.Component<Props> {
this.clearKeyboardTimeout();
Keyboard.dismiss();
const input = this.previouslyFocusedTextInput;
if (input) {
TextInput.State.blurTextInput(input);
}
// Cleanup the ID on successful page change
this.previouslyFocusedTextInput = null;

View File

@@ -271,8 +271,15 @@ export default class Card extends React.Component<Props> {
velocity = nativeEvent.velocityX;
}
const gestureDirectionFactor =
gestureDirection === 'horizontal' || gestureDirection === 'vertical'
? 1
: -1;
const closing =
translation + velocity * gestureVelocityImpact > distance / 2
gestureDirectionFactor *
(translation + velocity * gestureVelocityImpact) >
distance / 2
? velocity !== 0 || translation !== 0
: false;

View File

@@ -76,9 +76,6 @@ type State = {
const EPSILON = 0.01;
const dimensions = Dimensions.get('window');
const layout = { width: dimensions.width, height: dimensions.height };
const MaybeScreenContainer = ({
enabled,
...rest
@@ -161,7 +158,16 @@ const getProgressFromGesture = (
layout: Layout,
descriptor?: StackDescriptor
) => {
const distance = getDistanceFromOptions(mode, layout, descriptor);
const distance = getDistanceFromOptions(
mode,
{
// Make sure that we have a non-zero distance, otherwise there will be incorrect progress
// This causes blank screen on web if it was previously inside container with display: none
width: Math.max(1, layout.width),
height: Math.max(1, layout.height),
},
descriptor
);
if (distance > 0) {
return gesture.interpolate({
@@ -291,19 +297,25 @@ export default class CardStack extends React.Component<Props, State> {
};
}
state: State = {
routes: [],
scenes: [],
gestures: {},
layout,
descriptors: this.props.descriptors,
// Used when card's header is null and mode is float to make transition
// between screens with headers and those without headers smooth.
// This is not a great heuristic here. We don't know synchronously
// on mount what the header height is so we have just used the most
// common cases here.
headerHeights: {},
};
constructor(props: Props) {
super(props);
const { height = 0, width = 0 } = Dimensions.get('window');
this.state = {
routes: [],
scenes: [],
gestures: {},
layout: { height, width },
descriptors: this.props.descriptors,
// Used when card's header is null and mode is float to make transition
// between screens with headers and those without headers smooth.
// This is not a great heuristic here. We don't know synchronously
// on mount what the header height is so we have just used the most
// common cases here.
headerHeights: {},
};
}
private handleLayout = (e: LayoutChangeEvent) => {
const { height, width } = e.nativeEvent.layout;
@@ -403,9 +415,9 @@ export default class CardStack extends React.Component<Props, State> {
left = insets.left,
} = focusedOptions.safeAreaInsets || {};
// Screens is buggy on iOS, so we don't enable it there
// Screens is buggy on iOS and web, so we only enable it on Android
// For modals, usually we want the screen underneath to be visible, so also disable it there
const isScreensEnabled = Platform.OS !== 'ios' && mode !== 'modal';
const isScreensEnabled = Platform.OS === 'android' && mode !== 'modal';
return (
<React.Fragment>

View File

@@ -3,6 +3,25 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [2.8.6](https://github.com/react-navigation/tabs/compare/react-navigation-tabs@2.8.5...react-navigation-tabs@2.8.6) (2020-03-20)
**Note:** Version bump only for package react-navigation-tabs
## [2.8.5](https://github.com/react-navigation/tabs/compare/react-navigation-tabs@2.8.4...react-navigation-tabs@2.8.5) (2020-03-19)
### Bug Fixes
* don't use react-native-screens on web ([44c3900](https://github.com/react-navigation/tabs/commit/44c390075f7b76664e09fd9a1a7926645133ebec)), closes [#7485](https://github.com/react-navigation/tabs/issues/7485)
## [2.8.4](https://github.com/react-navigation/tabs/compare/react-navigation-tabs@2.8.3...react-navigation-tabs@2.8.4) (2020-03-16)

View File

@@ -1,6 +1,6 @@
{
"name": "react-navigation-tabs",
"version": "2.8.4",
"version": "2.8.6",
"description": "Tab Navigation components for React Navigation",
"main": "lib/commonjs/index.js",
"module": "lib/module/index.js",
@@ -56,7 +56,7 @@
"react-native-gesture-handler": "^1.6.0",
"react-native-reanimated": "^1.2.0",
"react-native-tab-view": "^2.13.0",
"react-navigation": "^4.3.1",
"react-navigation": "^4.3.2",
"typescript": "~3.7.5"
},
"peerDependencies": {

View File

@@ -1,6 +1,5 @@
import * as React from 'react';
import { Platform, StyleSheet, View } from 'react-native';
import { Screen, screensEnabled } from 'react-native-screens';
type Props = {
@@ -9,12 +8,14 @@ type Props = {
style?: any;
};
const FAR_FAR_AWAY = 3000; // this should be big enough to move the whole view out of its container
const FAR_FAR_AWAY = 30000; // this should be big enough to move the whole view out of its container
export default class ResourceSavingScene extends React.Component<Props> {
render() {
if (screensEnabled?.()) {
// react-native-screens is buggy on web
if (screensEnabled?.() && Platform.OS !== 'web') {
const { isVisible, ...rest } = this.props;
// @ts-ignore
return <Screen active={isVisible ? 1 : 0} {...rest} />;
}
@@ -23,7 +24,13 @@ export default class ResourceSavingScene extends React.Component<Props> {
return (
<View
style={[styles.container, style, { opacity: isVisible ? 1 : 0 }]}
style={[
styles.container,
Platform.OS === 'web'
? { display: isVisible ? 'flex' : 'none' }
: null,
style,
]}
collapsable={false}
removeClippedSubviews={
// On iOS, set removeClippedSubviews to true only when not focused

View File

@@ -3268,10 +3268,10 @@
resolved "https://registry.yarnpkg.com/@react-native-community/masked-view/-/masked-view-0.1.7.tgz#a65ce0702f55cb67fd777995de6fc7b3e5781903"
integrity sha512-9KbP7LTLFz9dx1heURJbO6nuVMdSjDez8znlrUzaB1nUwKVsTTwlKRuHxGUYIIkReLWrJQeCv9tidy+84z2eCw==
"@react-navigation/stack@^5.2.0":
version "5.2.0"
resolved "https://registry.yarnpkg.com/@react-navigation/stack/-/stack-5.2.0.tgz#e16138cd23b457594e790999552ab3d72e8e2707"
integrity sha512-lFTVV1S9YEPsIxzLUPY95Y2lqmday79uOadOopQkjq3JWmZTXBJDMW9jgV8B+F5EfUh0VabQ2zX06OfjxrvtUw==
"@react-navigation/stack@^5.2.3":
version "5.2.3"
resolved "https://registry.yarnpkg.com/@react-navigation/stack/-/stack-5.2.3.tgz#2c92ee6f0a032720960acfa037e13061c378781e"
integrity sha512-mCji6N6r03sTMF09hbVmhdCZHcuIrZCr/MY8yuiG+kzzYcFfj+72wwJ885erKw32jBKAaJV8wZNq8W0K+ZiCQQ==
dependencies:
color "^3.1.2"
react-native-iphone-x-helper "^1.2.1"