mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-01-14 09:32:32 +08:00
Compare commits
17 Commits
@react-nav
...
@react-nav
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
01f86d2ac6 | ||
|
|
c49dab31b2 | ||
|
|
16e7ac131f | ||
|
|
9e3650831c | ||
|
|
e523138321 | ||
|
|
cc8f1f4205 | ||
|
|
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
|
- name: Publish Expo app
|
||||||
working-directory: ./example
|
working-directory: ./example
|
||||||
run: expo publish --release-channel=pr-${{ github.event.number }}
|
run: expo publish --release-channel=pr-${{ github.event.number }}
|
||||||
|
env:
|
||||||
|
EXPO_USE_DEV_SERVER: true
|
||||||
|
|
||||||
- name: Get expo link
|
- name: Get expo link
|
||||||
id: expo
|
id: expo
|
||||||
|
|||||||
@@ -13,49 +13,50 @@
|
|||||||
"test": "jest"
|
"test": "jest"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@expo/vector-icons": "^10.2.0",
|
"@expo/vector-icons": "^10.0.0",
|
||||||
"@react-native-community/masked-view": "^0.1.10",
|
"@react-native-community/masked-view": "0.1.10",
|
||||||
"color": "^3.1.2",
|
"color": "^3.1.2",
|
||||||
"expo": "^38.0.9",
|
"expo": "^39.0.0",
|
||||||
"expo-asset": "~8.1.7",
|
"expo-asset": "~8.2.0",
|
||||||
"expo-blur": "~8.1.2",
|
"expo-blur": "~8.2.0",
|
||||||
"expo-linking": "^1.0.3",
|
"expo-linking": "^1.0.4",
|
||||||
"expo-updates": "~0.2.14",
|
"expo-updates": "~0.3.5",
|
||||||
"koa": "^2.13.0",
|
"koa": "^2.13.0",
|
||||||
"react": "~16.9.0",
|
"react": "~16.13.1",
|
||||||
"react-dom": "~16.9.0",
|
"react-dom": "~16.13.1",
|
||||||
"react-native": "~0.62.2",
|
"react-native": "~0.63.2",
|
||||||
"react-native-appearance": "~0.3.3",
|
"react-native-appearance": "~0.3.3",
|
||||||
"react-native-gesture-handler": "^1.7.0",
|
"react-native-gesture-handler": "~1.7.0",
|
||||||
"react-native-paper": "^4.0.1",
|
"react-native-paper": "^4.2.0",
|
||||||
"react-native-reanimated": "^1.10.1",
|
"react-native-reanimated": "~1.13.0",
|
||||||
"react-native-safe-area-context": "~3.1.1",
|
"react-native-safe-area-context": "3.1.4",
|
||||||
"react-native-screens": "^2.9.0",
|
"react-native-screens": "~2.10.1",
|
||||||
"react-native-tab-view": "^2.15.1",
|
"react-native-tab-view": "^2.15.2",
|
||||||
"react-native-vector-icons": "^7.0.0",
|
"react-native-vector-icons": "^7.0.0",
|
||||||
"react-native-web": "^0.11.7"
|
"react-native-web": "^0.13.16"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/node": "^7.10.1",
|
"@babel/node": "^7.10.1",
|
||||||
"@expo/webpack-config": "^0.12.21",
|
"@expo/webpack-config": "^0.12.38",
|
||||||
"@types/cheerio": "^0.22.21",
|
"@types/cheerio": "^0.22.22",
|
||||||
"@types/jest-dev-server": "^4.2.0",
|
"@types/jest-dev-server": "^4.2.0",
|
||||||
"@types/koa": "^2.11.3",
|
"@types/koa": "^2.11.4",
|
||||||
"@types/node-fetch": "^2.5.7",
|
"@types/node-fetch": "^2.5.7",
|
||||||
"@types/react": "~16.9.44",
|
"@types/react": "~16.9.51",
|
||||||
"@types/react-dom": "^16.9.8",
|
"@types/react-dom": "^16.9.8",
|
||||||
"@types/react-native": "~0.63.4",
|
"@types/react-native": "~0.63.25",
|
||||||
|
"babel-loader": "^8.1.0",
|
||||||
"babel-plugin-module-resolver": "^4.0.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",
|
"cheerio": "^1.0.0-rc.3",
|
||||||
"expo-cli": "^3.23.1",
|
"expo-cli": "^3.27.14",
|
||||||
"jest": "^26.2.2",
|
"jest": "^26.5.2",
|
||||||
"jest-dev-server": "^4.4.0",
|
"jest-dev-server": "^4.4.0",
|
||||||
"mock-require-assets": "^0.0.1",
|
"mock-require-assets": "^0.0.1",
|
||||||
"node-fetch": "^2.6.0",
|
"node-fetch": "^2.6.1",
|
||||||
"nodemon": "^2.0.4",
|
"nodemon": "^2.0.4",
|
||||||
"playwright": "^0.14.0",
|
"playwright": "^0.14.0",
|
||||||
"serve": "^11.3.0",
|
"serve": "^11.3.0",
|
||||||
"typescript": "~3.9.5"
|
"typescript": "^4.0.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -67,13 +67,6 @@ type RootDrawerParamList = {
|
|||||||
Another: undefined;
|
Another: undefined;
|
||||||
};
|
};
|
||||||
|
|
||||||
type RootStackParamList = {
|
|
||||||
Home: undefined;
|
|
||||||
NotFound: undefined;
|
|
||||||
} & {
|
|
||||||
[P in keyof typeof SCREENS]: undefined;
|
|
||||||
};
|
|
||||||
|
|
||||||
const SCREENS = {
|
const SCREENS = {
|
||||||
SimpleStack: { title: 'Simple Stack', component: SimpleStack },
|
SimpleStack: { title: 'Simple Stack', component: SimpleStack },
|
||||||
ModalPresentationStack: {
|
ModalPresentationStack: {
|
||||||
@@ -123,6 +116,13 @@ const SCREENS = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
type RootStackParamList = {
|
||||||
|
Home: undefined;
|
||||||
|
NotFound: undefined;
|
||||||
|
} & {
|
||||||
|
[P in keyof typeof SCREENS]: undefined;
|
||||||
|
};
|
||||||
|
|
||||||
const Drawer = createDrawerNavigator<RootDrawerParamList>();
|
const Drawer = createDrawerNavigator<RootDrawerParamList>();
|
||||||
const Stack = createStackNavigator<RootStackParamList>();
|
const Stack = createStackNavigator<RootStackParamList>();
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
const path = require('path');
|
const path = require('path');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const createExpoWebpackConfigAsync = require('@expo/webpack-config');
|
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 node_modules = path.resolve(__dirname, '..', 'node_modules');
|
||||||
const packages = path.resolve(__dirname, '..', 'packages');
|
const packages = path.resolve(__dirname, '..', 'packages');
|
||||||
@@ -19,10 +17,6 @@ module.exports = async function (env, argv) {
|
|||||||
use: 'babel-loader',
|
use: 'babel-loader',
|
||||||
});
|
});
|
||||||
|
|
||||||
config.resolve.plugins = config.resolve.plugins.filter(
|
|
||||||
(p) => !(p instanceof ModuleScopePlugin)
|
|
||||||
);
|
|
||||||
|
|
||||||
Object.assign(config.resolve.alias, {
|
Object.assign(config.resolve.alias, {
|
||||||
'react': path.resolve(node_modules, 'react'),
|
'react': path.resolve(node_modules, 'react'),
|
||||||
'react-native': path.resolve(node_modules, 'react-native-web'),
|
'react-native': path.resolve(node_modules, 'react-native-web'),
|
||||||
|
|||||||
28
package.json
28
package.json
@@ -25,23 +25,23 @@
|
|||||||
"example": "yarn --cwd example"
|
"example": "yarn --cwd example"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@commitlint/config-conventional": "^9.1.1",
|
"@commitlint/config-conventional": "^11.0.0",
|
||||||
"@types/jest": "^26.0.8",
|
"@types/jest": "^26.0.14",
|
||||||
"babel-jest": "^26.2.2",
|
"babel-jest": "^26.5.2",
|
||||||
"codecov": "^3.7.2",
|
"codecov": "^3.8.0",
|
||||||
"commitlint": "^9.1.0",
|
"commitlint": "^11.0.0",
|
||||||
"eslint": "^7.6.0",
|
"eslint": "^7.10.0",
|
||||||
"eslint-config-satya164": "^3.1.7",
|
"eslint-config-satya164": "^3.1.8",
|
||||||
"husky": "^4.2.5",
|
"husky": "^4.3.0",
|
||||||
"jest": "^26.2.2",
|
"jest": "^26.5.2",
|
||||||
"lerna": "^3.22.1",
|
"lerna": "^3.22.1",
|
||||||
"metro-react-native-babel-preset": "^0.61.0",
|
"metro-react-native-babel-preset": "^0.63.0",
|
||||||
"prettier": "^2.0.5",
|
"prettier": "^2.1.2",
|
||||||
"typescript": "^3.9.7"
|
"typescript": "^4.0.3"
|
||||||
},
|
},
|
||||||
"resolutions": {
|
"resolutions": {
|
||||||
"react": "~16.9.0",
|
"react": "~16.13.1",
|
||||||
"react-native": "~0.62.2"
|
"react-native": "~0.63.2"
|
||||||
},
|
},
|
||||||
"husky": {
|
"husky": {
|
||||||
"hooks": {
|
"hooks": {
|
||||||
|
|||||||
@@ -3,6 +3,42 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [5.9.2](https://github.com/react-navigation/react-navigation/compare/@react-navigation/bottom-tabs@5.9.1...@react-navigation/bottom-tabs@5.9.2) (2020-10-07)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* use route keys instead of index for lazy load ([c49dab3](https://github.com/react-navigation/react-navigation/commit/c49dab31b2c63a1735f0ed0a1936ecf7bbcd8b13))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [5.9.1](https://github.com/react-navigation/react-navigation/compare/@react-navigation/bottom-tabs@5.9.0...@react-navigation/bottom-tabs@5.9.1) (2020-09-28)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @react-navigation/bottom-tabs
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# [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)
|
# [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.
|
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",
|
"name": "@react-navigation/bottom-tabs",
|
||||||
"description": "Bottom tab navigator following iOS design guidelines",
|
"description": "Bottom tab navigator following iOS design guidelines",
|
||||||
"version": "5.8.0",
|
"version": "5.9.2",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"react-native-component",
|
"react-native-component",
|
||||||
"react-component",
|
"react-component",
|
||||||
@@ -41,17 +41,17 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@react-native-community/bob": "^0.16.2",
|
"@react-native-community/bob": "^0.16.2",
|
||||||
"@react-navigation/native": "^5.7.3",
|
"@react-navigation/native": "^5.7.6",
|
||||||
"@testing-library/react-native": "^7.0.1",
|
"@testing-library/react-native": "^7.0.2",
|
||||||
"@types/color": "^3.0.1",
|
"@types/color": "^3.0.1",
|
||||||
"@types/react": "^16.9.44",
|
"@types/react": "^16.9.51",
|
||||||
"@types/react-native": "^0.63.4",
|
"@types/react-native": "^0.63.25",
|
||||||
"del-cli": "^3.0.1",
|
"del-cli": "^3.0.1",
|
||||||
"react": "~16.9.0",
|
"react": "~16.13.1",
|
||||||
"react-native": "~0.62.2",
|
"react-native": "~0.63.2",
|
||||||
"react-native-safe-area-context": "~3.1.1",
|
"react-native-safe-area-context": "3.1.4",
|
||||||
"react-native-screens": "^2.9.0",
|
"react-native-screens": "~2.10.1",
|
||||||
"typescript": "^3.9.7"
|
"typescript": "^4.0.3"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@react-navigation/native": "^5.0.5",
|
"@react-navigation/native": "^5.0.5",
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ export default function useWindowDimensions() {
|
|||||||
|
|
||||||
Dimensions.addEventListener('change', onChange);
|
Dimensions.addEventListener('change', onChange);
|
||||||
|
|
||||||
return () => Dimensions.addEventListener('change', onChange);
|
return () => Dimensions.removeEventListener('change', onChange);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return dimensions;
|
return dimensions;
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ type Props = BottomTabBarProps & {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const DEFAULT_TABBAR_HEIGHT = 49;
|
const DEFAULT_TABBAR_HEIGHT = 49;
|
||||||
|
const COMPACT_TABBAR_HEIGHT = 32;
|
||||||
const DEFAULT_MAX_TAB_ITEM_WIDTH = 125;
|
const DEFAULT_MAX_TAB_ITEM_WIDTH = 125;
|
||||||
|
|
||||||
const useNativeDriver = Platform.OS !== 'web';
|
const useNativeDriver = Platform.OS !== 'web';
|
||||||
@@ -119,6 +120,8 @@ export default function BottomTabBar({
|
|||||||
width: dimensions.width,
|
width: dimensions.width,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const isLandscape = () => dimensions.width > dimensions.height;
|
||||||
|
|
||||||
const handleLayout = (e: LayoutChangeEvent) => {
|
const handleLayout = (e: LayoutChangeEvent) => {
|
||||||
const { height, width } = e.nativeEvent.layout;
|
const { height, width } = e.nativeEvent.layout;
|
||||||
|
|
||||||
@@ -160,9 +163,7 @@ export default function BottomTabBar({
|
|||||||
|
|
||||||
return routes.length * maxTabItemWidth <= layout.width;
|
return routes.length * maxTabItemWidth <= layout.width;
|
||||||
} else {
|
} else {
|
||||||
const isLandscape = dimensions.width > dimensions.height;
|
return isLandscape();
|
||||||
|
|
||||||
return isLandscape;
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -180,6 +181,18 @@ export default function BottomTabBar({
|
|||||||
0
|
0
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const getDefaultTabBarHeight = () => {
|
||||||
|
if (
|
||||||
|
Platform.OS === 'ios' &&
|
||||||
|
!Platform.isPad &&
|
||||||
|
isLandscape() &&
|
||||||
|
shouldUseHorizontalLabels()
|
||||||
|
) {
|
||||||
|
return COMPACT_TABBAR_HEIGHT;
|
||||||
|
}
|
||||||
|
return DEFAULT_TABBAR_HEIGHT;
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Animated.View
|
<Animated.View
|
||||||
style={[
|
style={[
|
||||||
@@ -193,7 +206,10 @@ export default function BottomTabBar({
|
|||||||
{
|
{
|
||||||
translateY: visible.interpolate({
|
translateY: visible.interpolate({
|
||||||
inputRange: [0, 1],
|
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),
|
position: isTabBarHidden ? 'absolute' : (null as any),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
height: DEFAULT_TABBAR_HEIGHT + paddingBottom,
|
height: getDefaultTabBarHeight() + paddingBottom,
|
||||||
paddingBottom,
|
paddingBottom,
|
||||||
paddingHorizontal: Math.max(insets.left, insets.right),
|
paddingHorizontal: Math.max(insets.left, insets.right),
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ type Props = BottomTabNavigationConfig & {
|
|||||||
};
|
};
|
||||||
|
|
||||||
type State = {
|
type State = {
|
||||||
loaded: number[];
|
loaded: string[];
|
||||||
};
|
};
|
||||||
|
|
||||||
function SceneContent({
|
function SceneContent({
|
||||||
@@ -54,18 +54,18 @@ export default class BottomTabView extends React.Component<Props, State> {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static getDerivedStateFromProps(nextProps: Props, prevState: State) {
|
static getDerivedStateFromProps(nextProps: Props, prevState: State) {
|
||||||
const { index } = nextProps.state;
|
const focusedRouteKey = nextProps.state.routes[nextProps.state.index].key;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
// Set the current tab to be loaded if it was not loaded before
|
// Set the current tab to be loaded if it was not loaded before
|
||||||
loaded: prevState.loaded.includes(index)
|
loaded: prevState.loaded.includes(focusedRouteKey)
|
||||||
? prevState.loaded
|
? prevState.loaded
|
||||||
: [...prevState.loaded, index],
|
: [...prevState.loaded, focusedRouteKey],
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
state = {
|
state: State = {
|
||||||
loaded: [this.props.state.index],
|
loaded: [this.props.state.routes[this.props.state.index].key],
|
||||||
};
|
};
|
||||||
|
|
||||||
private renderTabBar = () => {
|
private renderTabBar = () => {
|
||||||
@@ -103,7 +103,7 @@ export default class BottomTabView extends React.Component<Props, State> {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lazy && !loaded.includes(index) && !isFocused) {
|
if (lazy && !loaded.includes(route.key) && !isFocused) {
|
||||||
// Don't render a screen if we've never navigated to it
|
// Don't render a screen if we've never navigated to it
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,30 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [5.2.8](https://github.com/react-navigation/react-navigation/compare/@react-navigation/compat@5.2.7...@react-navigation/compat@5.2.8) (2020-10-07)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @react-navigation/compat
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [5.2.7](https://github.com/react-navigation/react-navigation/compare/@react-navigation/compat@5.2.6...@react-navigation/compat@5.2.7) (2020-09-28)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @react-navigation/compat
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [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)
|
## [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
|
**Note:** Version bump only for package @react-navigation/compat
|
||||||
|
|||||||
@@ -2,4 +2,4 @@
|
|||||||
|
|
||||||
Compatibility layer to write navigator definitions in static configuration format.
|
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",
|
"name": "@react-navigation/compat",
|
||||||
"description": "Compatibility layer to write navigator definitions in static configuration format",
|
"description": "Compatibility layer to write navigator definitions in static configuration format",
|
||||||
"version": "5.2.5",
|
"version": "5.2.8",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
@@ -11,7 +11,7 @@
|
|||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/react-navigation/react-navigation/issues"
|
"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",
|
"main": "lib/commonjs/index.js",
|
||||||
"react-native": "src/index.tsx",
|
"react-native": "src/index.tsx",
|
||||||
"source": "src/index.tsx",
|
"source": "src/index.tsx",
|
||||||
@@ -32,10 +32,10 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@react-native-community/bob": "^0.16.2",
|
"@react-native-community/bob": "^0.16.2",
|
||||||
"@react-navigation/native": "^5.7.3",
|
"@react-navigation/native": "^5.7.6",
|
||||||
"@types/react": "^16.9.44",
|
"@types/react": "^16.9.51",
|
||||||
"react": "~16.9.0",
|
"react": "~16.13.1",
|
||||||
"typescript": "^3.9.7"
|
"typescript": "^4.0.3"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@react-navigation/native": "^5.0.5",
|
"@react-navigation/native": "^5.0.5",
|
||||||
|
|||||||
@@ -12,7 +12,9 @@ export function navigate(
|
|||||||
params?: object,
|
params?: object,
|
||||||
action?: never
|
action?: never
|
||||||
): NavigateActionType;
|
): NavigateActionType;
|
||||||
|
// eslint-disable-next-line no-redeclare
|
||||||
export function navigate(options: NavigateActionPayload): NavigateActionType;
|
export function navigate(options: NavigateActionPayload): NavigateActionType;
|
||||||
|
// eslint-disable-next-line no-redeclare
|
||||||
export function navigate(
|
export function navigate(
|
||||||
options: string | NavigateActionPayload,
|
options: string | NavigateActionPayload,
|
||||||
params?: object,
|
params?: object,
|
||||||
|
|||||||
@@ -3,6 +3,25 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [5.12.5](https://github.com/react-navigation/react-navigation/compare/@react-navigation/core@5.12.4...@react-navigation/core@5.12.5) (2020-10-07)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @react-navigation/core
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [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)
|
## [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
|
**Note:** Version bump only for package @react-navigation/core
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@react-navigation/core",
|
"name": "@react-navigation/core",
|
||||||
"description": "Core utilities for building navigators",
|
"description": "Core utilities for building navigators",
|
||||||
"version": "5.12.3",
|
"version": "5.12.5",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"react",
|
"react",
|
||||||
"react-native",
|
"react-native",
|
||||||
@@ -35,23 +35,23 @@
|
|||||||
"clean": "del lib"
|
"clean": "del lib"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@react-navigation/routers": "^5.4.11",
|
"@react-navigation/routers": "^5.4.12",
|
||||||
"escape-string-regexp": "^4.0.0",
|
"escape-string-regexp": "^4.0.0",
|
||||||
"nanoid": "^3.1.12",
|
"nanoid": "^3.1.12",
|
||||||
"query-string": "^6.13.1",
|
"query-string": "^6.13.5",
|
||||||
"react-is": "^16.13.0",
|
"react-is": "^16.13.0",
|
||||||
"use-subscription": "^1.4.0"
|
"use-subscription": "^1.4.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@react-native-community/bob": "^0.16.2",
|
"@react-native-community/bob": "^0.16.2",
|
||||||
"@testing-library/react-native": "^7.0.1",
|
"@testing-library/react-native": "^7.0.2",
|
||||||
"@types/react": "^16.9.44",
|
"@types/react": "^16.9.51",
|
||||||
"@types/react-is": "^16.7.1",
|
"@types/react-is": "^16.7.1",
|
||||||
"@types/use-subscription": "^1.0.0",
|
"@types/use-subscription": "^1.0.0",
|
||||||
"del-cli": "^3.0.1",
|
"del-cli": "^3.0.1",
|
||||||
"react": "~16.9.0",
|
"react": "~16.13.1",
|
||||||
"react-test-renderer": "~16.13.1",
|
"react-test-renderer": "~16.13.1",
|
||||||
"typescript": "^3.9.7"
|
"typescript": "^4.0.3"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"react": "*"
|
"react": "*"
|
||||||
|
|||||||
@@ -714,26 +714,22 @@ it('navigates to nested child in a navigator', () => {
|
|||||||
|
|
||||||
expect(element).toMatchInlineSnapshot(`"[foo-a, undefined]"`);
|
expect(element).toMatchInlineSnapshot(`"[foo-a, undefined]"`);
|
||||||
|
|
||||||
act(
|
act(() =>
|
||||||
() =>
|
navigation.current?.navigate('bar', {
|
||||||
navigation.current &&
|
screen: 'bar-b',
|
||||||
navigation.current.navigate('bar', {
|
params: { test: 42 },
|
||||||
screen: 'bar-b',
|
})
|
||||||
params: { test: 42 },
|
|
||||||
})
|
|
||||||
);
|
);
|
||||||
|
|
||||||
expect(element).toMatchInlineSnapshot(
|
expect(element).toMatchInlineSnapshot(
|
||||||
`"[bar-b, {\\"some\\":\\"stuff\\",\\"test\\":42}]"`
|
`"[bar-b, {\\"some\\":\\"stuff\\",\\"test\\":42}]"`
|
||||||
);
|
);
|
||||||
|
|
||||||
act(
|
act(() =>
|
||||||
() =>
|
navigation.current?.navigate('bar', {
|
||||||
navigation.current &&
|
screen: 'bar-a',
|
||||||
navigation.current.navigate('bar', {
|
params: { whoa: 'test' },
|
||||||
screen: 'bar-a',
|
})
|
||||||
params: { whoa: 'test' },
|
|
||||||
})
|
|
||||||
);
|
);
|
||||||
|
|
||||||
expect(element).toMatchInlineSnapshot(
|
expect(element).toMatchInlineSnapshot(
|
||||||
@@ -855,13 +851,11 @@ it('navigates to nested child in a navigator with initial: false', () => {
|
|||||||
type: 'test',
|
type: 'test',
|
||||||
});
|
});
|
||||||
|
|
||||||
act(
|
act(() =>
|
||||||
() =>
|
navigation.current?.navigate('bar', {
|
||||||
navigation.current &&
|
screen: 'bar-b',
|
||||||
navigation.current.navigate('bar', {
|
params: { test: 42 },
|
||||||
screen: 'bar-b',
|
})
|
||||||
params: { test: 42 },
|
|
||||||
})
|
|
||||||
);
|
);
|
||||||
|
|
||||||
expect(first).toMatchInlineSnapshot(
|
expect(first).toMatchInlineSnapshot(
|
||||||
@@ -962,14 +956,12 @@ it('navigates to nested child in a navigator with initial: false', () => {
|
|||||||
type: 'test',
|
type: 'test',
|
||||||
});
|
});
|
||||||
|
|
||||||
act(
|
act(() =>
|
||||||
() =>
|
navigation.current?.navigate('bar', {
|
||||||
navigation.current &&
|
screen: 'bar-b',
|
||||||
navigation.current.navigate('bar', {
|
params: { test: 42 },
|
||||||
screen: 'bar-b',
|
initial: false,
|
||||||
params: { test: 42 },
|
})
|
||||||
initial: false,
|
|
||||||
})
|
|
||||||
);
|
);
|
||||||
|
|
||||||
expect(second).toMatchInlineSnapshot(`"[bar-b, {\\"test\\":42}]"`);
|
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
|
// If one of the patterns starts with the other, it's more exhaustive
|
||||||
// So move it up
|
// So move it up
|
||||||
if (a.pattern.startsWith(b.pattern)) {
|
if (a.pattern.startsWith(b.pattern)) {
|
||||||
return 1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (b.pattern.startsWith(a.pattern)) {
|
if (b.pattern.startsWith(a.pattern)) {
|
||||||
@@ -570,10 +570,7 @@ const createRouteObjects = (
|
|||||||
const value = allParams![p];
|
const value = allParams![p];
|
||||||
|
|
||||||
if (value) {
|
if (value) {
|
||||||
acc[key] =
|
acc[key] = config.parse?.[key] ? config.parse[key](value) : value;
|
||||||
config.parse && config.parse[key]
|
|
||||||
? config.parse[key](value)
|
|
||||||
: value;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return acc;
|
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
|
// Copy the current list of callbacks in case they are mutated during execution
|
||||||
const callbacks =
|
const callbacks =
|
||||||
target !== undefined
|
target !== undefined
|
||||||
? items[target] && items[target].slice()
|
? items[target]?.slice()
|
||||||
: ([] as Listeners)
|
: ([] as Listeners)
|
||||||
.concat(...Object.keys(items).map((t) => items[t]))
|
.concat(...Object.keys(items).map((t) => items[t]))
|
||||||
.filter((cb, i, self) => self.lastIndexOf(cb) === i);
|
.filter((cb, i, self) => self.lastIndexOf(cb) === i);
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ const getRouteConfigsFromChildren = <
|
|||||||
throw new Error(
|
throw new Error(
|
||||||
`A navigator can only contain 'Screen' components as its direct children (found '${
|
`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
|
// @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,22 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [5.1.7](https://github.com/react-navigation/react-navigation/compare/@react-navigation/devtools@5.1.6...@react-navigation/devtools@5.1.7) (2020-10-07)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @react-navigation/devtools
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [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)
|
## [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
|
**Note:** Version bump only for package @react-navigation/devtools
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@react-navigation/devtools",
|
"name": "@react-navigation/devtools",
|
||||||
"description": "Developer tools for React Navigation",
|
"description": "Developer tools for React Navigation",
|
||||||
"version": "5.1.5",
|
"version": "5.1.7",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"react",
|
"react",
|
||||||
"react-native",
|
"react-native",
|
||||||
@@ -36,17 +36,17 @@
|
|||||||
"clean": "del lib"
|
"clean": "del lib"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@react-navigation/core": "^5.12.3",
|
"@react-navigation/core": "^5.12.5",
|
||||||
"deep-equal": "^2.0.3"
|
"deep-equal": "^2.0.4"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@react-native-community/bob": "^0.16.2",
|
"@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/deep-equal": "^1.0.1",
|
||||||
"@types/react": "^16.9.44",
|
"@types/react": "^16.9.51",
|
||||||
"del-cli": "^3.0.1",
|
"del-cli": "^3.0.1",
|
||||||
"react": "~16.9.0",
|
"react": "~16.13.1",
|
||||||
"typescript": "^3.9.7"
|
"typescript": "^4.0.3"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"react": "*"
|
"react": "*"
|
||||||
|
|||||||
@@ -3,6 +3,37 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [5.9.3](https://github.com/react-navigation/react-navigation/compare/@react-navigation/drawer@5.9.2...@react-navigation/drawer@5.9.3) (2020-10-07)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* use route keys instead of index for lazy load ([c49dab3](https://github.com/react-navigation/react-navigation/commit/c49dab31b2c63a1735f0ed0a1936ecf7bbcd8b13))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [5.9.2](https://github.com/react-navigation/react-navigation/compare/@react-navigation/drawer@5.9.1...@react-navigation/drawer@5.9.2) (2020-09-28)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @react-navigation/drawer
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [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)
|
# [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.
|
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",
|
"name": "@react-navigation/drawer",
|
||||||
"description": "Drawer navigator component with animated transitions and gesturess",
|
"description": "Drawer navigator component with animated transitions and gesturess",
|
||||||
"version": "5.9.0",
|
"version": "5.9.3",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"react-native-component",
|
"react-native-component",
|
||||||
"react-component",
|
"react-component",
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/react-navigation/react-navigation/issues"
|
"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",
|
"main": "lib/commonjs/index.js",
|
||||||
"react-native": "src/index.tsx",
|
"react-native": "src/index.tsx",
|
||||||
"source": "src/index.tsx",
|
"source": "src/index.tsx",
|
||||||
@@ -46,18 +46,18 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@react-native-community/bob": "^0.16.2",
|
"@react-native-community/bob": "^0.16.2",
|
||||||
"@react-navigation/native": "^5.7.3",
|
"@react-navigation/native": "^5.7.6",
|
||||||
"@testing-library/react-native": "^7.0.1",
|
"@testing-library/react-native": "^7.0.2",
|
||||||
"@types/react": "^16.9.44",
|
"@types/react": "^16.9.51",
|
||||||
"@types/react-native": "^0.63.4",
|
"@types/react-native": "^0.63.25",
|
||||||
"del-cli": "^3.0.1",
|
"del-cli": "^3.0.1",
|
||||||
"react": "~16.9.0",
|
"react": "~16.13.1",
|
||||||
"react-native": "~0.62.2",
|
"react-native": "~0.63.2",
|
||||||
"react-native-gesture-handler": "^1.7.0",
|
"react-native-gesture-handler": "~1.7.0",
|
||||||
"react-native-reanimated": "^1.10.1",
|
"react-native-reanimated": "~1.13.0",
|
||||||
"react-native-safe-area-context": "~3.1.1",
|
"react-native-safe-area-context": "3.1.4",
|
||||||
"react-native-screens": "^2.9.0",
|
"react-native-screens": "~2.10.1",
|
||||||
"typescript": "^3.9.7"
|
"typescript": "^4.0.3"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@react-navigation/native": "^5.0.5",
|
"@react-navigation/native": "^5.0.5",
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ export default function useWindowDimensions() {
|
|||||||
|
|
||||||
Dimensions.addEventListener('change', onChange);
|
Dimensions.addEventListener('change', onChange);
|
||||||
|
|
||||||
return () => Dimensions.addEventListener('change', onChange);
|
return () => Dimensions.removeEventListener('change', onChange);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return dimensions;
|
return dimensions;
|
||||||
|
|||||||
@@ -205,6 +205,7 @@ const styles = StyleSheet.create({
|
|||||||
},
|
},
|
||||||
label: {
|
label: {
|
||||||
marginRight: 32,
|
marginRight: 32,
|
||||||
|
flex: 1,
|
||||||
},
|
},
|
||||||
button: {
|
button: {
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ const getDefaultDrawerWidth = ({
|
|||||||
/*
|
/*
|
||||||
* Default drawer width is screen width - header height
|
* Default drawer width is screen width - header height
|
||||||
* with a max width of 280 on mobile and 320 on tablet
|
* 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 smallerAxisSize = Math.min(height, width);
|
||||||
const isLandscape = width > height;
|
const isLandscape = width > height;
|
||||||
@@ -83,7 +83,7 @@ export default function DrawerView({
|
|||||||
minSwipeDistance,
|
minSwipeDistance,
|
||||||
sceneContainerStyle,
|
sceneContainerStyle,
|
||||||
}: Props) {
|
}: Props) {
|
||||||
const [loaded, setLoaded] = React.useState([state.index]);
|
const [loaded, setLoaded] = React.useState([state.routes[state.index].key]);
|
||||||
const dimensions = useWindowDimensions();
|
const dimensions = useWindowDimensions();
|
||||||
|
|
||||||
const { colors } = useTheme();
|
const { colors } = useTheme();
|
||||||
@@ -129,8 +129,10 @@ export default function DrawerView({
|
|||||||
return () => subscription?.remove();
|
return () => subscription?.remove();
|
||||||
}, [handleDrawerClose, isDrawerOpen, navigation, state.key]);
|
}, [handleDrawerClose, isDrawerOpen, navigation, state.key]);
|
||||||
|
|
||||||
if (!loaded.includes(state.index)) {
|
const focusedRouteKey = state.routes[state.index].key;
|
||||||
setLoaded([...loaded, state.index]);
|
|
||||||
|
if (!loaded.includes(focusedRouteKey)) {
|
||||||
|
setLoaded([...loaded, focusedRouteKey]);
|
||||||
}
|
}
|
||||||
|
|
||||||
const renderNavigationView = ({ progress }: any) => {
|
const renderNavigationView = ({ progress }: any) => {
|
||||||
@@ -159,7 +161,7 @@ export default function DrawerView({
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lazy && !loaded.includes(index) && !isFocused) {
|
if (lazy && !loaded.includes(route.key) && !isFocused) {
|
||||||
// Don't render a screen if we've never navigated to it
|
// Don't render a screen if we've never navigated to it
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,30 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [5.2.19](https://github.com/react-navigation/react-navigation/compare/@react-navigation/material-bottom-tabs@5.2.18...@react-navigation/material-bottom-tabs@5.2.19) (2020-10-07)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @react-navigation/material-bottom-tabs
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [5.2.18](https://github.com/react-navigation/react-navigation/compare/@react-navigation/material-bottom-tabs@5.2.17...@react-navigation/material-bottom-tabs@5.2.18) (2020-09-28)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @react-navigation/material-bottom-tabs
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [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)
|
## [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
|
**Note:** Version bump only for package @react-navigation/material-bottom-tabs
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# `@react-navigation/material-bottom-tabs`
|
# `@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",
|
"name": "@react-navigation/material-bottom-tabs",
|
||||||
"description": "Integration for bottom navigation component from react-native-paper",
|
"description": "Integration for bottom navigation component from react-native-paper",
|
||||||
"version": "5.2.16",
|
"version": "5.2.19",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"react-native-component",
|
"react-native-component",
|
||||||
"react-component",
|
"react-component",
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/react-navigation/react-navigation/issues"
|
"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",
|
"main": "lib/commonjs/index.js",
|
||||||
"react-native": "src/index.tsx",
|
"react-native": "src/index.tsx",
|
||||||
"source": "src/index.tsx",
|
"source": "src/index.tsx",
|
||||||
@@ -42,17 +42,17 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@react-native-community/bob": "^0.16.2",
|
"@react-native-community/bob": "^0.16.2",
|
||||||
"@react-navigation/native": "^5.7.3",
|
"@react-navigation/native": "^5.7.6",
|
||||||
"@testing-library/react-native": "^7.0.1",
|
"@testing-library/react-native": "^7.0.2",
|
||||||
"@types/react": "^16.9.44",
|
"@types/react": "^16.9.51",
|
||||||
"@types/react-native": "^0.63.4",
|
"@types/react-native": "^0.63.25",
|
||||||
"@types/react-native-vector-icons": "^6.4.5",
|
"@types/react-native-vector-icons": "^6.4.6",
|
||||||
"del-cli": "^3.0.1",
|
"del-cli": "^3.0.1",
|
||||||
"react": "~16.9.0",
|
"react": "~16.13.1",
|
||||||
"react-native": "~0.62.2",
|
"react-native": "~0.63.2",
|
||||||
"react-native-paper": "^4.0.1",
|
"react-native-paper": "^4.2.0",
|
||||||
"react-native-vector-icons": "^7.0.0",
|
"react-native-vector-icons": "^7.0.0",
|
||||||
"typescript": "^3.9.7"
|
"typescript": "^4.0.3"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@react-navigation/native": "^5.0.5",
|
"@react-navigation/native": "^5.0.5",
|
||||||
|
|||||||
@@ -3,6 +3,30 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [5.2.19](https://github.com/react-navigation/react-navigation/compare/@react-navigation/material-top-tabs@5.2.18...@react-navigation/material-top-tabs@5.2.19) (2020-10-07)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @react-navigation/material-top-tabs
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [5.2.18](https://github.com/react-navigation/react-navigation/compare/@react-navigation/material-top-tabs@5.2.17...@react-navigation/material-top-tabs@5.2.18) (2020-09-28)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @react-navigation/material-top-tabs
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [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)
|
## [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
|
**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).
|
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",
|
"name": "@react-navigation/material-top-tabs",
|
||||||
"description": "Integration for the animated tab view component from react-native-tab-view",
|
"description": "Integration for the animated tab view component from react-native-tab-view",
|
||||||
"version": "5.2.16",
|
"version": "5.2.19",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"react-native-component",
|
"react-native-component",
|
||||||
"react-component",
|
"react-component",
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/react-navigation/react-navigation/issues"
|
"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",
|
"main": "lib/commonjs/index.js",
|
||||||
"react-native": "src/index.tsx",
|
"react-native": "src/index.tsx",
|
||||||
"source": "src/index.tsx",
|
"source": "src/index.tsx",
|
||||||
@@ -45,17 +45,17 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@react-native-community/bob": "^0.16.2",
|
"@react-native-community/bob": "^0.16.2",
|
||||||
"@react-navigation/native": "^5.7.3",
|
"@react-navigation/native": "^5.7.6",
|
||||||
"@testing-library/react-native": "^7.0.1",
|
"@testing-library/react-native": "^7.0.2",
|
||||||
"@types/react": "^16.9.44",
|
"@types/react": "^16.9.51",
|
||||||
"@types/react-native": "^0.63.4",
|
"@types/react-native": "^0.63.25",
|
||||||
"del-cli": "^3.0.1",
|
"del-cli": "^3.0.1",
|
||||||
"react": "~16.9.0",
|
"react": "~16.13.1",
|
||||||
"react-native": "~0.62.2",
|
"react-native": "~0.63.2",
|
||||||
"react-native-gesture-handler": "^1.7.0",
|
"react-native-gesture-handler": "~1.7.0",
|
||||||
"react-native-reanimated": "^1.10.1",
|
"react-native-reanimated": "~1.13.0",
|
||||||
"react-native-tab-view": "^2.15.1",
|
"react-native-tab-view": "^2.15.2",
|
||||||
"typescript": "^3.9.7"
|
"typescript": "^4.0.3"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@react-navigation/native": "^5.0.5",
|
"@react-navigation/native": "^5.0.5",
|
||||||
|
|||||||
@@ -3,6 +3,36 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [5.7.6](https://github.com/react-navigation/react-navigation/compare/@react-navigation/native@5.7.5...@react-navigation/native@5.7.6) (2020-10-07)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* add missing check for initial state on web ([9e36508](https://github.com/react-navigation/react-navigation/commit/9e3650831c22b47130d2b388390f7eb7910fe91d))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [5.7.5](https://github.com/react-navigation/react-navigation/compare/@react-navigation/native@5.7.4...@react-navigation/native@5.7.5) (2020-09-28)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* check for correct resolved value in useThenable. fixes [#8798](https://github.com/react-navigation/react-navigation/issues/8798) ([cc8f1f4](https://github.com/react-navigation/react-navigation/commit/cc8f1f4205373f605fc457b40666305b3e117772))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [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)
|
## [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.
|
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",
|
"name": "@react-navigation/native",
|
||||||
"description": "React Native integration for React Navigation",
|
"description": "React Native integration for React Navigation",
|
||||||
"version": "5.7.3",
|
"version": "5.7.6",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"react-native",
|
"react-native",
|
||||||
"react-navigation",
|
"react-navigation",
|
||||||
@@ -37,20 +37,20 @@
|
|||||||
"clean": "del lib"
|
"clean": "del lib"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@react-navigation/core": "^5.12.3",
|
"@react-navigation/core": "^5.12.5",
|
||||||
"nanoid": "^3.1.12"
|
"nanoid": "^3.1.12"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@react-native-community/bob": "^0.16.2",
|
"@react-native-community/bob": "^0.16.2",
|
||||||
"@testing-library/react-native": "^7.0.1",
|
"@testing-library/react-native": "^7.0.2",
|
||||||
"@types/react": "^16.9.44",
|
"@types/react": "^16.9.51",
|
||||||
"@types/react-dom": "^16.9.8",
|
"@types/react-dom": "^16.9.8",
|
||||||
"@types/react-native": "^0.63.4",
|
"@types/react-native": "^0.63.25",
|
||||||
"del-cli": "^3.0.1",
|
"del-cli": "^3.0.1",
|
||||||
"react": "~16.9.0",
|
"react": "~16.13.1",
|
||||||
"react-dom": "^16.13.1",
|
"react-dom": "^16.13.1",
|
||||||
"react-native": "~0.62.2",
|
"react-native": "~0.63.2",
|
||||||
"typescript": "^3.9.7"
|
"typescript": "^4.0.3"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"react": "*",
|
"react": "*",
|
||||||
|
|||||||
@@ -423,13 +423,16 @@ export default function useLinking(
|
|||||||
// We need to record the current metadata on the first render if they aren't set
|
// We need to record the current metadata on the first render if they aren't set
|
||||||
// This will allow the initial state to be in the history entry
|
// This will allow the initial state to be in the history entry
|
||||||
const state = ref.current.getRootState();
|
const state = ref.current.getRootState();
|
||||||
const path = getPathFromStateRef.current(state, configRef.current);
|
|
||||||
|
|
||||||
if (previousStateRef.current === undefined) {
|
if (state) {
|
||||||
previousStateRef.current = state;
|
const path = getPathFromStateRef.current(state, configRef.current);
|
||||||
|
|
||||||
|
if (previousStateRef.current === undefined) {
|
||||||
|
previousStateRef.current = state;
|
||||||
|
}
|
||||||
|
|
||||||
|
history.replace({ path, state });
|
||||||
}
|
}
|
||||||
|
|
||||||
history.replace({ path, state });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const onStateChange = async () => {
|
const onStateChange = async () => {
|
||||||
|
|||||||
@@ -3,19 +3,15 @@ import * as React from 'react';
|
|||||||
export default function useThenable<T>(create: () => PromiseLike<T>) {
|
export default function useThenable<T>(create: () => PromiseLike<T>) {
|
||||||
const [promise] = React.useState(create);
|
const [promise] = React.useState(create);
|
||||||
|
|
||||||
// Check if our thenable is synchronous
|
let initialState: [boolean, T | undefined] = [false, undefined];
|
||||||
let resolved = false;
|
|
||||||
let value: T | undefined;
|
|
||||||
|
|
||||||
|
// Check if our thenable is synchronous
|
||||||
promise.then((result) => {
|
promise.then((result) => {
|
||||||
resolved = true;
|
initialState = [true, result];
|
||||||
value = result;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const [state, setState] = React.useState<[boolean, T | undefined]>([
|
const [state, setState] = React.useState(initialState);
|
||||||
resolved,
|
const [resolved] = state;
|
||||||
value,
|
|
||||||
]);
|
|
||||||
|
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
let cancelled = false;
|
let cancelled = false;
|
||||||
|
|||||||
@@ -3,6 +3,14 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
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)
|
## [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
|
**Note:** Version bump only for package @react-navigation/routers
|
||||||
|
|||||||
@@ -14,4 +14,4 @@ yarn add @react-navigation/routers
|
|||||||
|
|
||||||
## Usage
|
## 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",
|
"name": "@react-navigation/routers",
|
||||||
"description": "Routers to help build custom navigators",
|
"description": "Routers to help build custom navigators",
|
||||||
"version": "5.4.11",
|
"version": "5.4.12",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"react",
|
"react",
|
||||||
"react-native",
|
"react-native",
|
||||||
@@ -16,7 +16,7 @@
|
|||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/react-navigation/react-navigation/issues"
|
"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",
|
"main": "lib/commonjs/index.js",
|
||||||
"react-native": "src/index.tsx",
|
"react-native": "src/index.tsx",
|
||||||
"source": "src/index.tsx",
|
"source": "src/index.tsx",
|
||||||
@@ -41,7 +41,7 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@react-native-community/bob": "^0.16.2",
|
"@react-native-community/bob": "^0.16.2",
|
||||||
"del-cli": "^3.0.1",
|
"del-cli": "^3.0.1",
|
||||||
"typescript": "^3.9.7"
|
"typescript": "^4.0.3"
|
||||||
},
|
},
|
||||||
"@react-native-community/bob": {
|
"@react-native-community/bob": {
|
||||||
"source": "src",
|
"source": "src",
|
||||||
|
|||||||
@@ -43,7 +43,9 @@ export function navigate(
|
|||||||
| { key: string; params?: object }
|
| { key: string; params?: object }
|
||||||
| { name: string; key?: string; params?: object }
|
| { name: string; key?: string; params?: object }
|
||||||
): Action;
|
): Action;
|
||||||
|
// eslint-disable-next-line no-redeclare
|
||||||
export function navigate(name: string, params?: object): Action;
|
export function navigate(name: string, params?: object): Action;
|
||||||
|
// eslint-disable-next-line no-redeclare
|
||||||
export function navigate(...args: any): Action {
|
export function navigate(...args: any): Action {
|
||||||
if (typeof args[0] === 'string') {
|
if (typeof args[0] === 'string') {
|
||||||
return { type: 'NAVIGATE', payload: { name: args[0], params: args[1] } };
|
return { type: 'NAVIGATE', payload: { name: args[0], params: args[1] } };
|
||||||
|
|||||||
@@ -3,6 +3,33 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [5.9.3](https://github.com/react-navigation/react-navigation/compare/@react-navigation/stack@5.9.2...@react-navigation/stack@5.9.3) (2020-10-07)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @react-navigation/stack
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [5.9.2](https://github.com/react-navigation/react-navigation/compare/@react-navigation/stack@5.9.1...@react-navigation/stack@5.9.2) (2020-09-28)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @react-navigation/stack
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [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)
|
# [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.
|
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",
|
"name": "@react-navigation/stack",
|
||||||
"description": "Stack navigator component for iOS and Android with animated transitions and gestures",
|
"description": "Stack navigator component for iOS and Android with animated transitions and gestures",
|
||||||
"version": "5.9.0",
|
"version": "5.9.3",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"react-native-component",
|
"react-native-component",
|
||||||
"react-component",
|
"react-component",
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/react-navigation/react-navigation/issues"
|
"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",
|
"main": "lib/commonjs/index.js",
|
||||||
"react-native": "src/index.tsx",
|
"react-native": "src/index.tsx",
|
||||||
"source": "src/index.tsx",
|
"source": "src/index.tsx",
|
||||||
@@ -46,18 +46,18 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@react-native-community/bob": "^0.16.2",
|
"@react-native-community/bob": "^0.16.2",
|
||||||
"@react-native-community/masked-view": "^0.1.10",
|
"@react-native-community/masked-view": "^0.1.10",
|
||||||
"@react-navigation/native": "^5.7.3",
|
"@react-navigation/native": "^5.7.6",
|
||||||
"@testing-library/react-native": "^7.0.1",
|
"@testing-library/react-native": "^7.0.2",
|
||||||
"@types/color": "^3.0.1",
|
"@types/color": "^3.0.1",
|
||||||
"@types/react": "^16.9.44",
|
"@types/react": "^16.9.51",
|
||||||
"@types/react-native": "^0.63.4",
|
"@types/react-native": "^0.63.25",
|
||||||
"del-cli": "^3.0.1",
|
"del-cli": "^3.0.1",
|
||||||
"react": "~16.9.0",
|
"react": "~16.13.1",
|
||||||
"react-native": "~0.62.2",
|
"react-native": "~0.63.2",
|
||||||
"react-native-gesture-handler": "^1.7.0",
|
"react-native-gesture-handler": "~1.7.0",
|
||||||
"react-native-safe-area-context": "~3.1.1",
|
"react-native-safe-area-context": "3.1.4",
|
||||||
"react-native-screens": "^2.9.0",
|
"react-native-screens": "~2.10.1",
|
||||||
"typescript": "^3.9.7"
|
"typescript": "^4.0.3"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@react-native-community/masked-view": ">= 0.1.0",
|
"@react-native-community/masked-view": ">= 0.1.0",
|
||||||
|
|||||||
@@ -57,8 +57,7 @@ function StackNavigator({
|
|||||||
|
|
||||||
React.useEffect(
|
React.useEffect(
|
||||||
() =>
|
() =>
|
||||||
navigation.addListener &&
|
navigation.addListener?.('tabPress', (e) => {
|
||||||
navigation.addListener('tabPress', (e) => {
|
|
||||||
const isFocused = navigation.isFocused();
|
const isFocused = navigation.isFocused();
|
||||||
|
|
||||||
// Run the operation in the next frame so we're sure all listeners have been run
|
// 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 (
|
return (
|
||||||
<Animated.Text
|
<Animated.Text
|
||||||
accessibilityRole="header"
|
accessibilityRole="header"
|
||||||
|
aria-level="1"
|
||||||
numberOfLines={1}
|
numberOfLines={1}
|
||||||
{...rest}
|
{...rest}
|
||||||
style={[
|
style={[
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ export default class KeyboardManager extends React.Component<Props> {
|
|||||||
|
|
||||||
// Numeric id of the previously focused text input
|
// Numeric id of the previously focused text input
|
||||||
// When a gesture didn't change the tab, we can restore the focused input with this
|
// 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 startTimestamp: number = 0;
|
||||||
private keyboardTimeout: any;
|
private keyboardTimeout: any;
|
||||||
|
|
||||||
@@ -35,10 +35,8 @@ export default class KeyboardManager extends React.Component<Props> {
|
|||||||
|
|
||||||
this.clearKeyboardTimeout();
|
this.clearKeyboardTimeout();
|
||||||
|
|
||||||
// @ts-expect-error: currentlyFocusedInput is pretty new, so not in the type definitions
|
const input: any = TextInput.State.currentlyFocusedInput
|
||||||
const input = TextInput.State.currentlyFocusedInput
|
? TextInput.State.currentlyFocusedInput()
|
||||||
? // @ts-expect-error
|
|
||||||
TextInput.State.currentlyFocusedInput()
|
|
||||||
: TextInput.State.currentlyFocusedField();
|
: TextInput.State.currentlyFocusedField();
|
||||||
|
|
||||||
// When a page change begins, blur the currently focused input
|
// When a page change begins, blur the currently focused input
|
||||||
|
|||||||
Reference in New Issue
Block a user