mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-01-13 09:30:30 +08:00
Compare commits
11 Commits
@react-nav
...
@react-nav
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e18578f83f | ||
|
|
a6179b75ad | ||
|
|
9b03c8e3a4 | ||
|
|
2bb6603aa3 | ||
|
|
dcbfe52667 | ||
|
|
97c215d2f2 | ||
|
|
050447b9ac | ||
|
|
1c4bd6813b | ||
|
|
2d1da7ef2f | ||
|
|
70691acdfc | ||
|
|
ee71a05570 |
2
.github/workflows/expo-preview.yml
vendored
2
.github/workflows/expo-preview.yml
vendored
@@ -37,6 +37,8 @@ jobs:
|
||||
- name: Publish Expo app
|
||||
working-directory: ./example
|
||||
run: expo publish --release-channel=pr-${{ github.event.number }}
|
||||
env:
|
||||
EXPO_USE_DEV_SERVER: true
|
||||
|
||||
- name: Get expo link
|
||||
id: expo
|
||||
|
||||
@@ -13,49 +13,50 @@
|
||||
"test": "jest"
|
||||
},
|
||||
"dependencies": {
|
||||
"@expo/vector-icons": "^10.2.0",
|
||||
"@react-native-community/masked-view": "^0.1.10",
|
||||
"@expo/vector-icons": "^10.0.0",
|
||||
"@react-native-community/masked-view": "0.1.10",
|
||||
"color": "^3.1.2",
|
||||
"expo": "^38.0.9",
|
||||
"expo-asset": "~8.1.7",
|
||||
"expo-blur": "~8.1.2",
|
||||
"expo-linking": "^1.0.3",
|
||||
"expo-updates": "~0.2.14",
|
||||
"expo": "^39.0.0",
|
||||
"expo-asset": "~8.2.0",
|
||||
"expo-blur": "~8.2.0",
|
||||
"expo-linking": "^1.0.4",
|
||||
"expo-updates": "~0.3.3",
|
||||
"koa": "^2.13.0",
|
||||
"react": "~16.9.0",
|
||||
"react-dom": "~16.9.0",
|
||||
"react-native": "~0.62.2",
|
||||
"react": "~16.13.1",
|
||||
"react-dom": "~16.13.1",
|
||||
"react-native": "~0.63.2",
|
||||
"react-native-appearance": "~0.3.3",
|
||||
"react-native-gesture-handler": "^1.7.0",
|
||||
"react-native-paper": "^4.0.1",
|
||||
"react-native-reanimated": "^1.10.1",
|
||||
"react-native-safe-area-context": "~3.1.1",
|
||||
"react-native-screens": "^2.9.0",
|
||||
"react-native-gesture-handler": "~1.7.0",
|
||||
"react-native-paper": "^4.2.0",
|
||||
"react-native-reanimated": "~1.13.0",
|
||||
"react-native-safe-area-context": "3.1.4",
|
||||
"react-native-screens": "~2.10.1",
|
||||
"react-native-tab-view": "^2.15.1",
|
||||
"react-native-vector-icons": "^7.0.0",
|
||||
"react-native-web": "^0.11.7"
|
||||
"react-native-web": "^0.13.13"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/node": "^7.10.1",
|
||||
"@expo/webpack-config": "^0.12.21",
|
||||
"@types/cheerio": "^0.22.21",
|
||||
"@types/jest-dev-server": "^4.2.0",
|
||||
"@types/koa": "^2.11.3",
|
||||
"@types/koa": "^2.11.4",
|
||||
"@types/node-fetch": "^2.5.7",
|
||||
"@types/react": "~16.9.44",
|
||||
"@types/react": "~16.9.35",
|
||||
"@types/react-dom": "^16.9.8",
|
||||
"@types/react-native": "~0.63.4",
|
||||
"@types/react-native": "~0.63.2",
|
||||
"babel-loader": "^8.1.0",
|
||||
"babel-plugin-module-resolver": "^4.0.0",
|
||||
"babel-preset-expo": "^8.2.3",
|
||||
"babel-preset-expo": "^8.3.0",
|
||||
"cheerio": "^1.0.0-rc.3",
|
||||
"expo-cli": "^3.23.1",
|
||||
"jest": "^26.2.2",
|
||||
"expo-cli": "^3.27.7",
|
||||
"jest": "^26.4.2",
|
||||
"jest-dev-server": "^4.4.0",
|
||||
"mock-require-assets": "^0.0.1",
|
||||
"node-fetch": "^2.6.0",
|
||||
"node-fetch": "^2.6.1",
|
||||
"nodemon": "^2.0.4",
|
||||
"playwright": "^0.14.0",
|
||||
"serve": "^11.3.0",
|
||||
"typescript": "~3.9.5"
|
||||
"typescript": "^4.0.3"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,13 +67,6 @@ type RootDrawerParamList = {
|
||||
Another: undefined;
|
||||
};
|
||||
|
||||
type RootStackParamList = {
|
||||
Home: undefined;
|
||||
NotFound: undefined;
|
||||
} & {
|
||||
[P in keyof typeof SCREENS]: undefined;
|
||||
};
|
||||
|
||||
const SCREENS = {
|
||||
SimpleStack: { title: 'Simple Stack', component: SimpleStack },
|
||||
ModalPresentationStack: {
|
||||
@@ -123,6 +116,13 @@ const SCREENS = {
|
||||
},
|
||||
};
|
||||
|
||||
type RootStackParamList = {
|
||||
Home: undefined;
|
||||
NotFound: undefined;
|
||||
} & {
|
||||
[P in keyof typeof SCREENS]: undefined;
|
||||
};
|
||||
|
||||
const Drawer = createDrawerNavigator<RootDrawerParamList>();
|
||||
const Stack = createStackNavigator<RootStackParamList>();
|
||||
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
const path = require('path');
|
||||
const fs = require('fs');
|
||||
const createExpoWebpackConfigAsync = require('@expo/webpack-config');
|
||||
// eslint-disable-next-line import/no-extraneous-dependencies
|
||||
const ModuleScopePlugin = require('react-dev-utils/ModuleScopePlugin');
|
||||
|
||||
const node_modules = path.resolve(__dirname, '..', 'node_modules');
|
||||
const packages = path.resolve(__dirname, '..', 'packages');
|
||||
@@ -19,10 +17,6 @@ module.exports = async function (env, argv) {
|
||||
use: 'babel-loader',
|
||||
});
|
||||
|
||||
config.resolve.plugins = config.resolve.plugins.filter(
|
||||
(p) => !(p instanceof ModuleScopePlugin)
|
||||
);
|
||||
|
||||
Object.assign(config.resolve.alias, {
|
||||
'react': path.resolve(node_modules, 'react'),
|
||||
'react-native': path.resolve(node_modules, 'react-native-web'),
|
||||
|
||||
26
package.json
26
package.json
@@ -25,23 +25,23 @@
|
||||
"example": "yarn --cwd example"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@commitlint/config-conventional": "^9.1.1",
|
||||
"@types/jest": "^26.0.8",
|
||||
"babel-jest": "^26.2.2",
|
||||
"@commitlint/config-conventional": "^11.0.0",
|
||||
"@types/jest": "^26.0.14",
|
||||
"babel-jest": "^26.3.0",
|
||||
"codecov": "^3.7.2",
|
||||
"commitlint": "^9.1.0",
|
||||
"eslint": "^7.6.0",
|
||||
"eslint-config-satya164": "^3.1.7",
|
||||
"husky": "^4.2.5",
|
||||
"jest": "^26.2.2",
|
||||
"commitlint": "^11.0.0",
|
||||
"eslint": "^7.9.0",
|
||||
"eslint-config-satya164": "^3.1.8",
|
||||
"husky": "^4.3.0",
|
||||
"jest": "^26.4.2",
|
||||
"lerna": "^3.22.1",
|
||||
"metro-react-native-babel-preset": "^0.61.0",
|
||||
"prettier": "^2.0.5",
|
||||
"typescript": "^3.9.7"
|
||||
"metro-react-native-babel-preset": "^0.63.0",
|
||||
"prettier": "^2.1.2",
|
||||
"typescript": "^4.0.3"
|
||||
},
|
||||
"resolutions": {
|
||||
"react": "~16.9.0",
|
||||
"react-native": "~0.62.2"
|
||||
"react": "~16.13.1",
|
||||
"react-native": "~0.63.2"
|
||||
},
|
||||
"husky": {
|
||||
"hooks": {
|
||||
|
||||
@@ -3,6 +3,23 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
# [5.9.0](https://github.com/react-navigation/react-navigation/compare/@react-navigation/bottom-tabs@5.8.0...@react-navigation/bottom-tabs@5.9.0) (2020-09-22)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* cleanly removing event listeners in useWindowDimensions ([#8866](https://github.com/react-navigation/react-navigation/issues/8866)) ([dcbfe52](https://github.com/react-navigation/react-navigation/commit/dcbfe52667d14b0dbed6a353675d02189f7f7b5b))
|
||||
* fix border showing on hidden tab bar. closes [#8869](https://github.com/react-navigation/react-navigation/issues/8869) ([9b03c8e](https://github.com/react-navigation/react-navigation/commit/9b03c8e3a4e1552f9abaa2732a64e2136821e38d))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add compact size for bottom tabs ([#8728](https://github.com/react-navigation/react-navigation/issues/8728)) ([a6179b7](https://github.com/react-navigation/react-navigation/commit/a6179b75adba2282a9c12751bb8db3751c39d8e4))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [5.8.0](https://github.com/react-navigation/react-navigation/compare/@react-navigation/bottom-tabs@5.7.3...@react-navigation/bottom-tabs@5.8.0) (2020-08-04)
|
||||
|
||||
|
||||
|
||||
@@ -2,4 +2,4 @@
|
||||
|
||||
Bottom tab navigator for React Navigation following iOS design guidelines.
|
||||
|
||||
Installation instructions and documentation can be found on the [React Navigation website](https://reactnavigation.org/docs/bottom-tab-navigator.html).
|
||||
Installation instructions and documentation can be found on the [React Navigation website](https://reactnavigation.org/docs/bottom-tab-navigator/).
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@react-navigation/bottom-tabs",
|
||||
"description": "Bottom tab navigator following iOS design guidelines",
|
||||
"version": "5.8.0",
|
||||
"version": "5.9.0",
|
||||
"keywords": [
|
||||
"react-native-component",
|
||||
"react-component",
|
||||
@@ -41,17 +41,17 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@react-native-community/bob": "^0.16.2",
|
||||
"@react-navigation/native": "^5.7.3",
|
||||
"@testing-library/react-native": "^7.0.1",
|
||||
"@react-navigation/native": "^5.7.4",
|
||||
"@testing-library/react-native": "^7.0.2",
|
||||
"@types/color": "^3.0.1",
|
||||
"@types/react": "^16.9.44",
|
||||
"@types/react-native": "^0.63.4",
|
||||
"@types/react": "^16.9.49",
|
||||
"@types/react-native": "^0.63.20",
|
||||
"del-cli": "^3.0.1",
|
||||
"react": "~16.9.0",
|
||||
"react-native": "~0.62.2",
|
||||
"react-native-safe-area-context": "~3.1.1",
|
||||
"react-native-screens": "^2.9.0",
|
||||
"typescript": "^3.9.7"
|
||||
"react": "~16.13.1",
|
||||
"react-native": "~0.63.2",
|
||||
"react-native-safe-area-context": "3.1.4",
|
||||
"react-native-screens": "~2.10.1",
|
||||
"typescript": "^4.0.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@react-navigation/native": "^5.0.5",
|
||||
|
||||
@@ -30,7 +30,7 @@ export default function useWindowDimensions() {
|
||||
|
||||
Dimensions.addEventListener('change', onChange);
|
||||
|
||||
return () => Dimensions.addEventListener('change', onChange);
|
||||
return () => Dimensions.removeEventListener('change', onChange);
|
||||
}, []);
|
||||
|
||||
return dimensions;
|
||||
|
||||
@@ -26,6 +26,7 @@ type Props = BottomTabBarProps & {
|
||||
};
|
||||
|
||||
const DEFAULT_TABBAR_HEIGHT = 49;
|
||||
const COMPACT_TABBAR_HEIGHT = 32;
|
||||
const DEFAULT_MAX_TAB_ITEM_WIDTH = 125;
|
||||
|
||||
const useNativeDriver = Platform.OS !== 'web';
|
||||
@@ -119,6 +120,8 @@ export default function BottomTabBar({
|
||||
width: dimensions.width,
|
||||
});
|
||||
|
||||
const isLandscape = () => dimensions.width > dimensions.height;
|
||||
|
||||
const handleLayout = (e: LayoutChangeEvent) => {
|
||||
const { height, width } = e.nativeEvent.layout;
|
||||
|
||||
@@ -160,9 +163,7 @@ export default function BottomTabBar({
|
||||
|
||||
return routes.length * maxTabItemWidth <= layout.width;
|
||||
} else {
|
||||
const isLandscape = dimensions.width > dimensions.height;
|
||||
|
||||
return isLandscape;
|
||||
return isLandscape();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -180,6 +181,18 @@ export default function BottomTabBar({
|
||||
0
|
||||
);
|
||||
|
||||
const getDefaultTabBarHeight = () => {
|
||||
if (
|
||||
Platform.OS === 'ios' &&
|
||||
!Platform.isPad &&
|
||||
isLandscape() &&
|
||||
shouldUseHorizontalLabels()
|
||||
) {
|
||||
return COMPACT_TABBAR_HEIGHT;
|
||||
}
|
||||
return DEFAULT_TABBAR_HEIGHT;
|
||||
};
|
||||
|
||||
return (
|
||||
<Animated.View
|
||||
style={[
|
||||
@@ -193,7 +206,10 @@ export default function BottomTabBar({
|
||||
{
|
||||
translateY: visible.interpolate({
|
||||
inputRange: [0, 1],
|
||||
outputRange: [layout.height + paddingBottom, 0],
|
||||
outputRange: [
|
||||
layout.height + paddingBottom + StyleSheet.hairlineWidth,
|
||||
0,
|
||||
],
|
||||
}),
|
||||
},
|
||||
],
|
||||
@@ -202,7 +218,7 @@ export default function BottomTabBar({
|
||||
position: isTabBarHidden ? 'absolute' : (null as any),
|
||||
},
|
||||
{
|
||||
height: DEFAULT_TABBAR_HEIGHT + paddingBottom,
|
||||
height: getDefaultTabBarHeight() + paddingBottom,
|
||||
paddingBottom,
|
||||
paddingHorizontal: Math.max(insets.left, insets.right),
|
||||
},
|
||||
|
||||
@@ -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.
|
||||
|
||||
## [5.2.6](https://github.com/react-navigation/react-navigation/compare/@react-navigation/compat@5.2.5...@react-navigation/compat@5.2.6) (2020-09-22)
|
||||
|
||||
**Note:** Version bump only for package @react-navigation/compat
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [5.2.5](https://github.com/react-navigation/react-navigation/compare/@react-navigation/compat@5.2.4...@react-navigation/compat@5.2.5) (2020-08-04)
|
||||
|
||||
**Note:** Version bump only for package @react-navigation/compat
|
||||
|
||||
@@ -2,4 +2,4 @@
|
||||
|
||||
Compatibility layer to write navigator definitions in static configuration format.
|
||||
|
||||
Installation instructions and documentation can be found on the [React Navigation website](https://reactnavigation.org/docs/compatibility.html).
|
||||
Installation instructions and documentation can be found on the [React Navigation website](https://reactnavigation.org/docs/compatibility/).
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@react-navigation/compat",
|
||||
"description": "Compatibility layer to write navigator definitions in static configuration format",
|
||||
"version": "5.2.5",
|
||||
"version": "5.2.6",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -11,7 +11,7 @@
|
||||
"bugs": {
|
||||
"url": "https://github.com/react-navigation/react-navigation/issues"
|
||||
},
|
||||
"homepage": "https://reactnavigation.org/docs/compatibility.html",
|
||||
"homepage": "https://reactnavigation.org/docs/compatibility/",
|
||||
"main": "lib/commonjs/index.js",
|
||||
"react-native": "src/index.tsx",
|
||||
"source": "src/index.tsx",
|
||||
@@ -32,10 +32,10 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@react-native-community/bob": "^0.16.2",
|
||||
"@react-navigation/native": "^5.7.3",
|
||||
"@types/react": "^16.9.44",
|
||||
"react": "~16.9.0",
|
||||
"typescript": "^3.9.7"
|
||||
"@react-navigation/native": "^5.7.4",
|
||||
"@types/react": "^16.9.49",
|
||||
"react": "~16.13.1",
|
||||
"typescript": "^4.0.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@react-navigation/native": "^5.0.5",
|
||||
|
||||
@@ -12,7 +12,9 @@ export function navigate(
|
||||
params?: object,
|
||||
action?: never
|
||||
): NavigateActionType;
|
||||
// eslint-disable-next-line no-redeclare
|
||||
export function navigate(options: NavigateActionPayload): NavigateActionType;
|
||||
// eslint-disable-next-line no-redeclare
|
||||
export function navigate(
|
||||
options: string | NavigateActionPayload,
|
||||
params?: object,
|
||||
|
||||
@@ -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.
|
||||
|
||||
## [5.12.4](https://github.com/react-navigation/react-navigation/compare/@react-navigation/core@5.12.3...@react-navigation/core@5.12.4) (2020-09-22)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* typo in logic of getStateFromPath ([#8868](https://github.com/react-navigation/react-navigation/issues/8868)) ([97c215d](https://github.com/react-navigation/react-navigation/commit/97c215d2f2ea9f6bbade7503348827c5b6dc4186))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [5.12.3](https://github.com/react-navigation/react-navigation/compare/@react-navigation/core@5.12.2...@react-navigation/core@5.12.3) (2020-08-04)
|
||||
|
||||
**Note:** Version bump only for package @react-navigation/core
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@react-navigation/core",
|
||||
"description": "Core utilities for building navigators",
|
||||
"version": "5.12.3",
|
||||
"version": "5.12.4",
|
||||
"keywords": [
|
||||
"react",
|
||||
"react-native",
|
||||
@@ -35,7 +35,7 @@
|
||||
"clean": "del lib"
|
||||
},
|
||||
"dependencies": {
|
||||
"@react-navigation/routers": "^5.4.11",
|
||||
"@react-navigation/routers": "^5.4.12",
|
||||
"escape-string-regexp": "^4.0.0",
|
||||
"nanoid": "^3.1.12",
|
||||
"query-string": "^6.13.1",
|
||||
@@ -44,14 +44,14 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@react-native-community/bob": "^0.16.2",
|
||||
"@testing-library/react-native": "^7.0.1",
|
||||
"@types/react": "^16.9.44",
|
||||
"@testing-library/react-native": "^7.0.2",
|
||||
"@types/react": "^16.9.49",
|
||||
"@types/react-is": "^16.7.1",
|
||||
"@types/use-subscription": "^1.0.0",
|
||||
"del-cli": "^3.0.1",
|
||||
"react": "~16.9.0",
|
||||
"react": "~16.13.1",
|
||||
"react-test-renderer": "~16.13.1",
|
||||
"typescript": "^3.9.7"
|
||||
"typescript": "^4.0.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "*"
|
||||
|
||||
@@ -714,26 +714,22 @@ it('navigates to nested child in a navigator', () => {
|
||||
|
||||
expect(element).toMatchInlineSnapshot(`"[foo-a, undefined]"`);
|
||||
|
||||
act(
|
||||
() =>
|
||||
navigation.current &&
|
||||
navigation.current.navigate('bar', {
|
||||
screen: 'bar-b',
|
||||
params: { test: 42 },
|
||||
})
|
||||
act(() =>
|
||||
navigation.current?.navigate('bar', {
|
||||
screen: 'bar-b',
|
||||
params: { test: 42 },
|
||||
})
|
||||
);
|
||||
|
||||
expect(element).toMatchInlineSnapshot(
|
||||
`"[bar-b, {\\"some\\":\\"stuff\\",\\"test\\":42}]"`
|
||||
);
|
||||
|
||||
act(
|
||||
() =>
|
||||
navigation.current &&
|
||||
navigation.current.navigate('bar', {
|
||||
screen: 'bar-a',
|
||||
params: { whoa: 'test' },
|
||||
})
|
||||
act(() =>
|
||||
navigation.current?.navigate('bar', {
|
||||
screen: 'bar-a',
|
||||
params: { whoa: 'test' },
|
||||
})
|
||||
);
|
||||
|
||||
expect(element).toMatchInlineSnapshot(
|
||||
@@ -855,13 +851,11 @@ it('navigates to nested child in a navigator with initial: false', () => {
|
||||
type: 'test',
|
||||
});
|
||||
|
||||
act(
|
||||
() =>
|
||||
navigation.current &&
|
||||
navigation.current.navigate('bar', {
|
||||
screen: 'bar-b',
|
||||
params: { test: 42 },
|
||||
})
|
||||
act(() =>
|
||||
navigation.current?.navigate('bar', {
|
||||
screen: 'bar-b',
|
||||
params: { test: 42 },
|
||||
})
|
||||
);
|
||||
|
||||
expect(first).toMatchInlineSnapshot(
|
||||
@@ -962,14 +956,12 @@ it('navigates to nested child in a navigator with initial: false', () => {
|
||||
type: 'test',
|
||||
});
|
||||
|
||||
act(
|
||||
() =>
|
||||
navigation.current &&
|
||||
navigation.current.navigate('bar', {
|
||||
screen: 'bar-b',
|
||||
params: { test: 42 },
|
||||
initial: false,
|
||||
})
|
||||
act(() =>
|
||||
navigation.current?.navigate('bar', {
|
||||
screen: 'bar-b',
|
||||
params: { test: 42 },
|
||||
initial: false,
|
||||
})
|
||||
);
|
||||
|
||||
expect(second).toMatchInlineSnapshot(`"[bar-b, {\\"test\\":42}]"`);
|
||||
|
||||
@@ -122,7 +122,7 @@ export default function getStateFromPath(
|
||||
// If one of the patterns starts with the other, it's more exhaustive
|
||||
// So move it up
|
||||
if (a.pattern.startsWith(b.pattern)) {
|
||||
return 1;
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (b.pattern.startsWith(a.pattern)) {
|
||||
@@ -570,10 +570,7 @@ const createRouteObjects = (
|
||||
const value = allParams![p];
|
||||
|
||||
if (value) {
|
||||
acc[key] =
|
||||
config.parse && config.parse[key]
|
||||
? config.parse[key](value)
|
||||
: value;
|
||||
acc[key] = config.parse?.[key] ? config.parse[key](value) : value;
|
||||
}
|
||||
|
||||
return acc;
|
||||
|
||||
@@ -69,7 +69,7 @@ export default function useEventEmitter<T extends Record<string, any>>(
|
||||
// Copy the current list of callbacks in case they are mutated during execution
|
||||
const callbacks =
|
||||
target !== undefined
|
||||
? items[target] && items[target].slice()
|
||||
? items[target]?.slice()
|
||||
: ([] as Listeners)
|
||||
.concat(...Object.keys(items).map((t) => items[t]))
|
||||
.filter((cb, i, self) => self.lastIndexOf(cb) === i);
|
||||
|
||||
@@ -95,7 +95,7 @@ const getRouteConfigsFromChildren = <
|
||||
throw new Error(
|
||||
`A navigator can only contain 'Screen' components as its direct children (found '${
|
||||
// @ts-expect-error: child can be any type and we're accessing it safely, but TS doesn't understand it
|
||||
child.type && child.type.name ? child.type.name : String(child)
|
||||
child.type?.name ? child.type.name : String(child)
|
||||
}')`
|
||||
);
|
||||
}, []);
|
||||
|
||||
@@ -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.
|
||||
|
||||
## [5.1.6](https://github.com/react-navigation/react-navigation/compare/@react-navigation/devtools@5.1.5...@react-navigation/devtools@5.1.6) (2020-09-22)
|
||||
|
||||
**Note:** Version bump only for package @react-navigation/devtools
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [5.1.5](https://github.com/react-navigation/react-navigation/compare/@react-navigation/devtools@5.1.4...@react-navigation/devtools@5.1.5) (2020-08-04)
|
||||
|
||||
**Note:** Version bump only for package @react-navigation/devtools
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@react-navigation/devtools",
|
||||
"description": "Developer tools for React Navigation",
|
||||
"version": "5.1.5",
|
||||
"version": "5.1.6",
|
||||
"keywords": [
|
||||
"react",
|
||||
"react-native",
|
||||
@@ -36,17 +36,17 @@
|
||||
"clean": "del lib"
|
||||
},
|
||||
"dependencies": {
|
||||
"@react-navigation/core": "^5.12.3",
|
||||
"@react-navigation/core": "^5.12.4",
|
||||
"deep-equal": "^2.0.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@react-native-community/bob": "^0.16.2",
|
||||
"@testing-library/react-native": "^7.0.1",
|
||||
"@testing-library/react-native": "^7.0.2",
|
||||
"@types/deep-equal": "^1.0.1",
|
||||
"@types/react": "^16.9.44",
|
||||
"@types/react": "^16.9.49",
|
||||
"del-cli": "^3.0.1",
|
||||
"react": "~16.9.0",
|
||||
"typescript": "^3.9.7"
|
||||
"react": "~16.13.1",
|
||||
"typescript": "^4.0.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "*"
|
||||
|
||||
@@ -3,6 +3,18 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [5.9.1](https://github.com/react-navigation/react-navigation/compare/@react-navigation/drawer@5.9.0...@react-navigation/drawer@5.9.1) (2020-09-22)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* add flex: 1 to DrawerItem style ([#8701](https://github.com/react-navigation/react-navigation/issues/8701)) ([1c4bd68](https://github.com/react-navigation/react-navigation/commit/1c4bd6813bc6f5151fd2d99a0245331ff5631c38)), closes [/github.com/react-navigation/react-navigation/blob/main/packages/drawer/src/views/DrawerItem.tsx#L167](https://github.com//github.com/react-navigation/react-navigation/blob/main/packages/drawer/src/views/DrawerItem.tsx/issues/L167)
|
||||
* cleanly removing event listeners in useWindowDimensions ([#8866](https://github.com/react-navigation/react-navigation/issues/8866)) ([dcbfe52](https://github.com/react-navigation/react-navigation/commit/dcbfe52667d14b0dbed6a353675d02189f7f7b5b))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [5.9.0](https://github.com/react-navigation/react-navigation/compare/@react-navigation/drawer@5.8.7...@react-navigation/drawer@5.9.0) (2020-08-04)
|
||||
|
||||
|
||||
|
||||
@@ -2,4 +2,4 @@
|
||||
|
||||
Drawer navigator for React Navigation following Material Design guidelines.
|
||||
|
||||
Installation instructions and documentation can be found on the [React Navigation website](https://reactnavigation.org/docs/drawer-navigator.html).
|
||||
Installation instructions and documentation can be found on the [React Navigation website](https://reactnavigation.org/docs/drawer-navigator/).
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@react-navigation/drawer",
|
||||
"description": "Drawer navigator component with animated transitions and gesturess",
|
||||
"version": "5.9.0",
|
||||
"version": "5.9.1",
|
||||
"keywords": [
|
||||
"react-native-component",
|
||||
"react-component",
|
||||
@@ -21,7 +21,7 @@
|
||||
"bugs": {
|
||||
"url": "https://github.com/react-navigation/react-navigation/issues"
|
||||
},
|
||||
"homepage": "https://reactnavigation.org/docs/drawer-navigator.html",
|
||||
"homepage": "https://reactnavigation.org/docs/drawer-navigator/",
|
||||
"main": "lib/commonjs/index.js",
|
||||
"react-native": "src/index.tsx",
|
||||
"source": "src/index.tsx",
|
||||
@@ -46,18 +46,18 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@react-native-community/bob": "^0.16.2",
|
||||
"@react-navigation/native": "^5.7.3",
|
||||
"@testing-library/react-native": "^7.0.1",
|
||||
"@types/react": "^16.9.44",
|
||||
"@types/react-native": "^0.63.4",
|
||||
"@react-navigation/native": "^5.7.4",
|
||||
"@testing-library/react-native": "^7.0.2",
|
||||
"@types/react": "^16.9.49",
|
||||
"@types/react-native": "^0.63.20",
|
||||
"del-cli": "^3.0.1",
|
||||
"react": "~16.9.0",
|
||||
"react-native": "~0.62.2",
|
||||
"react-native-gesture-handler": "^1.7.0",
|
||||
"react-native-reanimated": "^1.10.1",
|
||||
"react-native-safe-area-context": "~3.1.1",
|
||||
"react-native-screens": "^2.9.0",
|
||||
"typescript": "^3.9.7"
|
||||
"react": "~16.13.1",
|
||||
"react-native": "~0.63.2",
|
||||
"react-native-gesture-handler": "~1.7.0",
|
||||
"react-native-reanimated": "~1.13.0",
|
||||
"react-native-safe-area-context": "3.1.4",
|
||||
"react-native-screens": "~2.10.1",
|
||||
"typescript": "^4.0.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@react-navigation/native": "^5.0.5",
|
||||
|
||||
@@ -30,7 +30,7 @@ export default function useWindowDimensions() {
|
||||
|
||||
Dimensions.addEventListener('change', onChange);
|
||||
|
||||
return () => Dimensions.addEventListener('change', onChange);
|
||||
return () => Dimensions.removeEventListener('change', onChange);
|
||||
}, []);
|
||||
|
||||
return dimensions;
|
||||
|
||||
@@ -205,6 +205,7 @@ const styles = StyleSheet.create({
|
||||
},
|
||||
label: {
|
||||
marginRight: 32,
|
||||
flex: 1,
|
||||
},
|
||||
button: {
|
||||
display: 'flex',
|
||||
|
||||
@@ -46,7 +46,7 @@ const getDefaultDrawerWidth = ({
|
||||
/*
|
||||
* Default drawer width is screen width - header height
|
||||
* with a max width of 280 on mobile and 320 on tablet
|
||||
* https://material.io/guidelines/patterns/navigation-drawer.html
|
||||
* https://material.io/components/navigation-drawer
|
||||
*/
|
||||
const smallerAxisSize = Math.min(height, width);
|
||||
const isLandscape = width > height;
|
||||
|
||||
@@ -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.
|
||||
|
||||
## [5.2.17](https://github.com/react-navigation/react-navigation/compare/@react-navigation/material-bottom-tabs@5.2.16...@react-navigation/material-bottom-tabs@5.2.17) (2020-09-22)
|
||||
|
||||
**Note:** Version bump only for package @react-navigation/material-bottom-tabs
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [5.2.16](https://github.com/react-navigation/react-navigation/compare/@react-navigation/material-bottom-tabs@5.2.15...@react-navigation/material-bottom-tabs@5.2.16) (2020-08-04)
|
||||
|
||||
**Note:** Version bump only for package @react-navigation/material-bottom-tabs
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# `@react-navigation/material-bottom-tabs`
|
||||
|
||||
React Navigation integration for [bottom navigation](https://material.io/design/components/bottom-navigation.html) component from [`react-native-paper`](https://callstack.github.io/react-native-paper/bottom-navigation.html).
|
||||
React Navigation integration for [bottom navigation](https://material.io/components/bottom-navigation) component from [`react-native-paper`](https://callstack.github.io/react-native-paper/bottom-navigation.html).
|
||||
|
||||
Installation instructions and documentation can be found on the [React Navigation website](https://reactnavigation.org/docs/material-bottom-tab-navigator.html).
|
||||
Installation instructions and documentation can be found on the [React Navigation website](https://reactnavigation.org/docs/material-bottom-tab-navigator/).
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@react-navigation/material-bottom-tabs",
|
||||
"description": "Integration for bottom navigation component from react-native-paper",
|
||||
"version": "5.2.16",
|
||||
"version": "5.2.17",
|
||||
"keywords": [
|
||||
"react-native-component",
|
||||
"react-component",
|
||||
@@ -21,7 +21,7 @@
|
||||
"bugs": {
|
||||
"url": "https://github.com/react-navigation/react-navigation/issues"
|
||||
},
|
||||
"homepage": "https://reactnavigation.org/docs/material-bottom-tab-navigator.html",
|
||||
"homepage": "https://reactnavigation.org/docs/material-bottom-tab-navigator/",
|
||||
"main": "lib/commonjs/index.js",
|
||||
"react-native": "src/index.tsx",
|
||||
"source": "src/index.tsx",
|
||||
@@ -42,17 +42,17 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@react-native-community/bob": "^0.16.2",
|
||||
"@react-navigation/native": "^5.7.3",
|
||||
"@testing-library/react-native": "^7.0.1",
|
||||
"@types/react": "^16.9.44",
|
||||
"@types/react-native": "^0.63.4",
|
||||
"@types/react-native-vector-icons": "^6.4.5",
|
||||
"@react-navigation/native": "^5.7.4",
|
||||
"@testing-library/react-native": "^7.0.2",
|
||||
"@types/react": "^16.9.49",
|
||||
"@types/react-native": "^0.63.20",
|
||||
"@types/react-native-vector-icons": "^6.4.6",
|
||||
"del-cli": "^3.0.1",
|
||||
"react": "~16.9.0",
|
||||
"react-native": "~0.62.2",
|
||||
"react-native-paper": "^4.0.1",
|
||||
"react": "~16.13.1",
|
||||
"react-native": "~0.63.2",
|
||||
"react-native-paper": "^4.2.0",
|
||||
"react-native-vector-icons": "^7.0.0",
|
||||
"typescript": "^3.9.7"
|
||||
"typescript": "^4.0.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@react-navigation/native": "^5.0.5",
|
||||
|
||||
@@ -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.
|
||||
|
||||
## [5.2.17](https://github.com/react-navigation/react-navigation/compare/@react-navigation/material-top-tabs@5.2.16...@react-navigation/material-top-tabs@5.2.17) (2020-09-22)
|
||||
|
||||
**Note:** Version bump only for package @react-navigation/material-top-tabs
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [5.2.16](https://github.com/react-navigation/react-navigation/compare/@react-navigation/material-top-tabs@5.2.15...@react-navigation/material-top-tabs@5.2.16) (2020-08-04)
|
||||
|
||||
**Note:** Version bump only for package @react-navigation/material-top-tabs
|
||||
|
||||
@@ -2,4 +2,4 @@
|
||||
|
||||
React Navigation integration for animated tab view component from [`react-native-tab-view`](https://github.com/react-native-community/react-native-tab-view).
|
||||
|
||||
Installation instructions and documentation can be found on the [React Navigation website](https://reactnavigation.org/docs/material-top-tab-navigator.html).
|
||||
Installation instructions and documentation can be found on the [React Navigation website](https://reactnavigation.org/docs/material-top-tab-navigator/).
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@react-navigation/material-top-tabs",
|
||||
"description": "Integration for the animated tab view component from react-native-tab-view",
|
||||
"version": "5.2.16",
|
||||
"version": "5.2.17",
|
||||
"keywords": [
|
||||
"react-native-component",
|
||||
"react-component",
|
||||
@@ -21,7 +21,7 @@
|
||||
"bugs": {
|
||||
"url": "https://github.com/react-navigation/react-navigation/issues"
|
||||
},
|
||||
"homepage": "https://reactnavigation.org/docs/material-top-tab-navigator.html",
|
||||
"homepage": "https://reactnavigation.org/docs/material-top-tab-navigator/",
|
||||
"main": "lib/commonjs/index.js",
|
||||
"react-native": "src/index.tsx",
|
||||
"source": "src/index.tsx",
|
||||
@@ -45,17 +45,17 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@react-native-community/bob": "^0.16.2",
|
||||
"@react-navigation/native": "^5.7.3",
|
||||
"@testing-library/react-native": "^7.0.1",
|
||||
"@types/react": "^16.9.44",
|
||||
"@types/react-native": "^0.63.4",
|
||||
"@react-navigation/native": "^5.7.4",
|
||||
"@testing-library/react-native": "^7.0.2",
|
||||
"@types/react": "^16.9.49",
|
||||
"@types/react-native": "^0.63.20",
|
||||
"del-cli": "^3.0.1",
|
||||
"react": "~16.9.0",
|
||||
"react-native": "~0.62.2",
|
||||
"react-native-gesture-handler": "^1.7.0",
|
||||
"react-native-reanimated": "^1.10.1",
|
||||
"react": "~16.13.1",
|
||||
"react-native": "~0.63.2",
|
||||
"react-native-gesture-handler": "~1.7.0",
|
||||
"react-native-reanimated": "~1.13.0",
|
||||
"react-native-tab-view": "^2.15.1",
|
||||
"typescript": "^3.9.7"
|
||||
"typescript": "^4.0.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@react-navigation/native": "^5.0.5",
|
||||
|
||||
@@ -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.
|
||||
|
||||
## [5.7.4](https://github.com/react-navigation/react-navigation/compare/@react-navigation/native@5.7.3...@react-navigation/native@5.7.4) (2020-09-22)
|
||||
|
||||
**Note:** Version bump only for package @react-navigation/native
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [5.7.3](https://github.com/react-navigation/react-navigation/compare/@react-navigation/native@5.7.2...@react-navigation/native@5.7.3) (2020-08-04)
|
||||
|
||||
|
||||
|
||||
@@ -2,4 +2,4 @@
|
||||
|
||||
React Native integration for React Navigation.
|
||||
|
||||
Installation instructions and documentation can be found on the [React Navigation website](https://reactnavigation.org/docs/getting-started.html).
|
||||
Installation instructions and documentation can be found on the [React Navigation website](https://reactnavigation.org/docs/getting-started/).
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@react-navigation/native",
|
||||
"description": "React Native integration for React Navigation",
|
||||
"version": "5.7.3",
|
||||
"version": "5.7.4",
|
||||
"keywords": [
|
||||
"react-native",
|
||||
"react-navigation",
|
||||
@@ -37,20 +37,20 @@
|
||||
"clean": "del lib"
|
||||
},
|
||||
"dependencies": {
|
||||
"@react-navigation/core": "^5.12.3",
|
||||
"@react-navigation/core": "^5.12.4",
|
||||
"nanoid": "^3.1.12"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@react-native-community/bob": "^0.16.2",
|
||||
"@testing-library/react-native": "^7.0.1",
|
||||
"@types/react": "^16.9.44",
|
||||
"@testing-library/react-native": "^7.0.2",
|
||||
"@types/react": "^16.9.49",
|
||||
"@types/react-dom": "^16.9.8",
|
||||
"@types/react-native": "^0.63.4",
|
||||
"@types/react-native": "^0.63.20",
|
||||
"del-cli": "^3.0.1",
|
||||
"react": "~16.9.0",
|
||||
"react": "~16.13.1",
|
||||
"react-dom": "^16.13.1",
|
||||
"react-native": "~0.62.2",
|
||||
"typescript": "^3.9.7"
|
||||
"react-native": "~0.63.2",
|
||||
"typescript": "^4.0.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "*",
|
||||
|
||||
@@ -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.
|
||||
|
||||
## [5.4.12](https://github.com/react-navigation/react-navigation/compare/@react-navigation/routers@5.4.11...@react-navigation/routers@5.4.12) (2020-09-22)
|
||||
|
||||
**Note:** Version bump only for package @react-navigation/routers
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [5.4.11](https://github.com/react-navigation/react-navigation/compare/@react-navigation/routers@5.4.10...@react-navigation/routers@5.4.11) (2020-08-04)
|
||||
|
||||
**Note:** Version bump only for package @react-navigation/routers
|
||||
|
||||
@@ -14,4 +14,4 @@ yarn add @react-navigation/routers
|
||||
|
||||
## Usage
|
||||
|
||||
Documentation can be found on the [React Navigation website](https://reactnavigation.org/docs/custom-routers.html).
|
||||
Documentation can be found on the [React Navigation website](https://reactnavigation.org/docs/custom-routers/).
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@react-navigation/routers",
|
||||
"description": "Routers to help build custom navigators",
|
||||
"version": "5.4.11",
|
||||
"version": "5.4.12",
|
||||
"keywords": [
|
||||
"react",
|
||||
"react-native",
|
||||
@@ -16,7 +16,7 @@
|
||||
"bugs": {
|
||||
"url": "https://github.com/react-navigation/react-navigation/issues"
|
||||
},
|
||||
"homepage": "https://reactnavigation.org/docs/custom-routers.html",
|
||||
"homepage": "https://reactnavigation.org/docs/custom-routers/",
|
||||
"main": "lib/commonjs/index.js",
|
||||
"react-native": "src/index.tsx",
|
||||
"source": "src/index.tsx",
|
||||
@@ -41,7 +41,7 @@
|
||||
"devDependencies": {
|
||||
"@react-native-community/bob": "^0.16.2",
|
||||
"del-cli": "^3.0.1",
|
||||
"typescript": "^3.9.7"
|
||||
"typescript": "^4.0.3"
|
||||
},
|
||||
"@react-native-community/bob": {
|
||||
"source": "src",
|
||||
|
||||
@@ -43,7 +43,9 @@ export function navigate(
|
||||
| { key: string; params?: object }
|
||||
| { name: string; key?: string; params?: object }
|
||||
): Action;
|
||||
// eslint-disable-next-line no-redeclare
|
||||
export function navigate(name: string, params?: object): Action;
|
||||
// eslint-disable-next-line no-redeclare
|
||||
export function navigate(...args: any): Action {
|
||||
if (typeof args[0] === 'string') {
|
||||
return { type: 'NAVIGATE', payload: { name: args[0], params: args[1] } };
|
||||
|
||||
@@ -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.
|
||||
|
||||
## [5.9.1](https://github.com/react-navigation/react-navigation/compare/@react-navigation/stack@5.9.0...@react-navigation/stack@5.9.1) (2020-09-22)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* add aria-level to HeaderTitle ([2d1da7e](https://github.com/react-navigation/react-navigation/commit/2d1da7ef2ffdb25f74e19e81b7e685fbb487f0c5))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [5.9.0](https://github.com/react-navigation/react-navigation/compare/@react-navigation/stack@5.8.0...@react-navigation/stack@5.9.0) (2020-08-04)
|
||||
|
||||
|
||||
|
||||
@@ -2,4 +2,4 @@
|
||||
|
||||
Stack navigator for React Navigation.
|
||||
|
||||
Installation instructions and documentation can be found on the [React Navigation website](https://reactnavigation.org/docs/stack-navigator.html).
|
||||
Installation instructions and documentation can be found on the [React Navigation website](https://reactnavigation.org/docs/stack-navigator/).
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@react-navigation/stack",
|
||||
"description": "Stack navigator component for iOS and Android with animated transitions and gestures",
|
||||
"version": "5.9.0",
|
||||
"version": "5.9.1",
|
||||
"keywords": [
|
||||
"react-native-component",
|
||||
"react-component",
|
||||
@@ -20,7 +20,7 @@
|
||||
"bugs": {
|
||||
"url": "https://github.com/react-navigation/react-navigation/issues"
|
||||
},
|
||||
"homepage": "https://reactnavigation.org/docs/stack-navigator.html",
|
||||
"homepage": "https://reactnavigation.org/docs/stack-navigator/",
|
||||
"main": "lib/commonjs/index.js",
|
||||
"react-native": "src/index.tsx",
|
||||
"source": "src/index.tsx",
|
||||
@@ -46,18 +46,18 @@
|
||||
"devDependencies": {
|
||||
"@react-native-community/bob": "^0.16.2",
|
||||
"@react-native-community/masked-view": "^0.1.10",
|
||||
"@react-navigation/native": "^5.7.3",
|
||||
"@testing-library/react-native": "^7.0.1",
|
||||
"@react-navigation/native": "^5.7.4",
|
||||
"@testing-library/react-native": "^7.0.2",
|
||||
"@types/color": "^3.0.1",
|
||||
"@types/react": "^16.9.44",
|
||||
"@types/react-native": "^0.63.4",
|
||||
"@types/react": "^16.9.49",
|
||||
"@types/react-native": "^0.63.20",
|
||||
"del-cli": "^3.0.1",
|
||||
"react": "~16.9.0",
|
||||
"react-native": "~0.62.2",
|
||||
"react-native-gesture-handler": "^1.7.0",
|
||||
"react-native-safe-area-context": "~3.1.1",
|
||||
"react-native-screens": "^2.9.0",
|
||||
"typescript": "^3.9.7"
|
||||
"react": "~16.13.1",
|
||||
"react-native": "~0.63.2",
|
||||
"react-native-gesture-handler": "~1.7.0",
|
||||
"react-native-safe-area-context": "3.1.4",
|
||||
"react-native-screens": "~2.10.1",
|
||||
"typescript": "^4.0.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@react-native-community/masked-view": ">= 0.1.0",
|
||||
|
||||
@@ -57,8 +57,7 @@ function StackNavigator({
|
||||
|
||||
React.useEffect(
|
||||
() =>
|
||||
navigation.addListener &&
|
||||
navigation.addListener('tabPress', (e) => {
|
||||
navigation.addListener?.('tabPress', (e) => {
|
||||
const isFocused = navigation.isFocused();
|
||||
|
||||
// Run the operation in the next frame so we're sure all listeners have been run
|
||||
|
||||
@@ -21,6 +21,7 @@ export default function HeaderTitle({ tintColor, style, ...rest }: Props) {
|
||||
return (
|
||||
<Animated.Text
|
||||
accessibilityRole="header"
|
||||
aria-level="1"
|
||||
numberOfLines={1}
|
||||
{...rest}
|
||||
style={[
|
||||
|
||||
@@ -17,7 +17,7 @@ export default class KeyboardManager extends React.Component<Props> {
|
||||
|
||||
// Numeric id of the previously focused text input
|
||||
// When a gesture didn't change the tab, we can restore the focused input with this
|
||||
private previouslyFocusedTextInput: number | null = null;
|
||||
private previouslyFocusedTextInput: any | null = null;
|
||||
private startTimestamp: number = 0;
|
||||
private keyboardTimeout: any;
|
||||
|
||||
@@ -35,10 +35,8 @@ export default class KeyboardManager extends React.Component<Props> {
|
||||
|
||||
this.clearKeyboardTimeout();
|
||||
|
||||
// @ts-expect-error: currentlyFocusedInput is pretty new, so not in the type definitions
|
||||
const input = TextInput.State.currentlyFocusedInput
|
||||
? // @ts-expect-error
|
||||
TextInput.State.currentlyFocusedInput()
|
||||
const input: any = TextInput.State.currentlyFocusedInput
|
||||
? TextInput.State.currentlyFocusedInput()
|
||||
: TextInput.State.currentlyFocusedField();
|
||||
|
||||
// When a page change begins, blur the currently focused input
|
||||
|
||||
Reference in New Issue
Block a user