Compare commits

...

17 Commits

Author SHA1 Message Date
Satyajit Sahoo
01f86d2ac6 chore: publish
- @react-navigation/bottom-tabs@5.9.2
 - @react-navigation/compat@5.2.8
 - @react-navigation/core@5.12.5
 - @react-navigation/devtools@5.1.7
 - @react-navigation/drawer@5.9.3
 - @react-navigation/material-bottom-tabs@5.2.19
 - @react-navigation/material-top-tabs@5.2.19
 - @react-navigation/native@5.7.6
 - @react-navigation/stack@5.9.3
2020-10-07 11:39:56 +02:00
Satyajit Sahoo
c49dab31b2 fix: use route keys instead of index for lazy load 2020-10-07 11:36:02 +02:00
Satyajit Sahoo
16e7ac131f chore: upgrade depenendecies 2020-10-07 11:18:38 +02:00
Satyajit Sahoo
9e3650831c fix: add missing check for initial state on web 2020-10-01 11:23:28 +02:00
Satyajit Sahoo
e523138321 chore: publish
- @react-navigation/bottom-tabs@5.9.1
 - @react-navigation/compat@5.2.7
 - @react-navigation/drawer@5.9.2
 - @react-navigation/material-bottom-tabs@5.2.18
 - @react-navigation/material-top-tabs@5.2.18
 - @react-navigation/native@5.7.5
 - @react-navigation/stack@5.9.2
2020-09-28 16:58:23 +02:00
Satyajit Sahoo
cc8f1f4205 fix: check for correct resolved value in useThenable. fixes #8798 2020-09-28 16:56:26 +02:00
Satyajit Sahoo
e18578f83f chore: publish
- @react-navigation/bottom-tabs@5.9.0
 - @react-navigation/compat@5.2.6
 - @react-navigation/core@5.12.4
 - @react-navigation/devtools@5.1.6
 - @react-navigation/drawer@5.9.1
 - @react-navigation/material-bottom-tabs@5.2.17
 - @react-navigation/material-top-tabs@5.2.17
 - @react-navigation/native@5.7.4
 - @react-navigation/routers@5.4.12
 - @react-navigation/stack@5.9.1
2020-09-23 01:44:39 +02:00
Bill Thornton
a6179b75ad feat: add compact size for bottom tabs (#8728)
This adds a compact height mode for iOS devices that are in a compact vertical class (phones in landscape). This is similar to the size change that happens to the header when in landscape mode. Finding a size reference was challenging since most apps lock phones to portrait, but [this answer](https://stackoverflow.com/a/25550871) on Stack Overflow states that it should be 32 pts.

I asked yesterday in the Discord chat if there would be interest in this and some other enhancements here, but no on replied, so I thought I would go ahead and open this to at least start a discussion.
2020-09-23 01:41:38 +02:00
Satyajit Sahoo
9b03c8e3a4 fix: fix border showing on hidden tab bar. closes #8869 2020-09-23 01:36:35 +02:00
Satyajit Sahoo
2bb6603aa3 chore: upgrade depenendecies 2020-09-23 01:34:55 +02:00
Martin Heidegger
dcbfe52667 fix: cleanly removing event listeners in useWindowDimensions (#8866)
This PR fixes the `useWindowDimensions` hook by making sure that the event listener is properly removed.
2020-09-21 13:01:22 +02:00
Thibault Malbranche
97c215d2f2 fix: typo in logic of getStateFromPath (#8868)
What just randomly reading, but I think there's a typo
```
['ab', 'aba'].sort((a, b) => {
      if (a.startsWith(b)) {
        return -1;
      }

      if (b.startsWith(a)) {
        return 1;
      }
});
(2) ["aba", "ab"]
['ab', 'a'].sort((a, b) => {
      if (a.startsWith(b)) {
        return -1;
      }

      if (b.startsWith(a)) {
        return 1;
      }
});
(2) ["ab", "a"]
```
2020-09-21 13:00:44 +02:00
Bartosz Kaszubowski
050447b9ac chore: update docs website URLs to avoid the redirect (#8819) 2020-09-10 13:34:16 +02:00
pedrobern
1c4bd6813b fix: add flex: 1 to DrawerItem style (#8701)
# Summary 

In the [DrawerItem](https://github.com/react-navigation/react-navigation/blob/main/packages/drawer/src/views/DrawerItem.tsx), It's not possible to provide style for the [label wrapper](https://github.com/react-navigation/react-navigation/blob/main/packages/drawer/src/views/DrawerItem.tsx#L167), only for the label, so the label wrapper must at least be `flex: 1` in order to be more flexible for custom components, like in the pictures below.

In the below examples, providing `flex: 1` inside the custom component view is not enough, because the wrapper does not grow. This PR will fix it.

An alternative would be creating a new prop `labelStyleWrapper`, but I don't see any motivation for doing so, as this PR would fix it.

## Before

![before](https://user-images.githubusercontent.com/39778068/89813734-81b45a80-db18-11ea-8d53-0ddcfdbb04c1.jpeg)

## After

![after](https://user-images.githubusercontent.com/39778068/89813748-8711a500-db18-11ea-92b4-3db982c1eba5.jpeg)
2020-09-02 16:22:31 +02:00
Louis-Alban KIM
2d1da7ef2f fix: add aria-level to HeaderTitle 2020-09-02 16:21:20 +02:00
Cedric van Putten
70691acdfc chore: enable faster bundling on preview builds
See https://twitter.com/expo/status/1293613036482121728
2020-09-02 16:01:08 +02:00
Brent Vatne
ee71a05570 chore: fix dependencies to be compatible with sdk-38 2020-08-24 11:12:06 +02:00
51 changed files with 3628 additions and 4400 deletions

View File

@@ -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

View File

@@ -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.5",
"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-tab-view": "^2.15.1",
"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.2",
"react-native-vector-icons": "^7.0.0",
"react-native-web": "^0.11.7"
"react-native-web": "^0.13.16"
},
"devDependencies": {
"@babel/node": "^7.10.1",
"@expo/webpack-config": "^0.12.21",
"@types/cheerio": "^0.22.21",
"@expo/webpack-config": "^0.12.38",
"@types/cheerio": "^0.22.22",
"@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.51",
"@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-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.14",
"jest": "^26.5.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"
}
}

View File

@@ -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>();

View File

@@ -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'),

View File

@@ -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",
"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/config-conventional": "^11.0.0",
"@types/jest": "^26.0.14",
"babel-jest": "^26.5.2",
"codecov": "^3.8.0",
"commitlint": "^11.0.0",
"eslint": "^7.10.0",
"eslint-config-satya164": "^3.1.8",
"husky": "^4.3.0",
"jest": "^26.5.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": {

View File

@@ -3,6 +3,42 @@
All notable changes to this project will be documented in this file.
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)

View File

@@ -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/).

View File

@@ -1,7 +1,7 @@
{
"name": "@react-navigation/bottom-tabs",
"description": "Bottom tab navigator following iOS design guidelines",
"version": "5.8.0",
"version": "5.9.2",
"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.6",
"@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.51",
"@types/react-native": "^0.63.25",
"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",

View File

@@ -30,7 +30,7 @@ export default function useWindowDimensions() {
Dimensions.addEventListener('change', onChange);
return () => Dimensions.addEventListener('change', onChange);
return () => Dimensions.removeEventListener('change', onChange);
}, []);
return dimensions;

View File

@@ -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),
},

View File

@@ -25,7 +25,7 @@ type Props = BottomTabNavigationConfig & {
};
type State = {
loaded: number[];
loaded: string[];
};
function SceneContent({
@@ -54,18 +54,18 @@ export default class BottomTabView extends React.Component<Props, State> {
};
static getDerivedStateFromProps(nextProps: Props, prevState: State) {
const { index } = nextProps.state;
const focusedRouteKey = nextProps.state.routes[nextProps.state.index].key;
return {
// 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, index],
: [...prevState.loaded, focusedRouteKey],
};
}
state = {
loaded: [this.props.state.index],
state: State = {
loaded: [this.props.state.routes[this.props.state.index].key],
};
private renderTabBar = () => {
@@ -103,7 +103,7 @@ export default class BottomTabView extends React.Component<Props, State> {
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
return null;
}

View File

@@ -3,6 +3,30 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [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)
**Note:** Version bump only for package @react-navigation/compat

View File

@@ -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/).

View File

@@ -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.8",
"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.6",
"@types/react": "^16.9.51",
"react": "~16.13.1",
"typescript": "^4.0.3"
},
"peerDependencies": {
"@react-navigation/native": "^5.0.5",

View File

@@ -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,

View File

@@ -3,6 +3,25 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [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)
**Note:** Version bump only for package @react-navigation/core

View File

@@ -1,7 +1,7 @@
{
"name": "@react-navigation/core",
"description": "Core utilities for building navigators",
"version": "5.12.3",
"version": "5.12.5",
"keywords": [
"react",
"react-native",
@@ -35,23 +35,23 @@
"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",
"query-string": "^6.13.5",
"react-is": "^16.13.0",
"use-subscription": "^1.4.0"
},
"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.51",
"@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": "*"

View File

@@ -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}]"`);

View File

@@ -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;

View File

@@ -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);

View File

@@ -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)
}')`
);
}, []);

View File

@@ -3,6 +3,22 @@
All notable changes to this project will be documented in this file.
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)
**Note:** Version bump only for package @react-navigation/devtools

View File

@@ -1,7 +1,7 @@
{
"name": "@react-navigation/devtools",
"description": "Developer tools for React Navigation",
"version": "5.1.5",
"version": "5.1.7",
"keywords": [
"react",
"react-native",
@@ -36,17 +36,17 @@
"clean": "del lib"
},
"dependencies": {
"@react-navigation/core": "^5.12.3",
"deep-equal": "^2.0.3"
"@react-navigation/core": "^5.12.5",
"deep-equal": "^2.0.4"
},
"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.51",
"del-cli": "^3.0.1",
"react": "~16.9.0",
"typescript": "^3.9.7"
"react": "~16.13.1",
"typescript": "^4.0.3"
},
"peerDependencies": {
"react": "*"

View File

@@ -3,6 +3,37 @@
All notable changes to this project will be documented in this file.
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)

View File

@@ -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/).

View File

@@ -1,7 +1,7 @@
{
"name": "@react-navigation/drawer",
"description": "Drawer navigator component with animated transitions and gesturess",
"version": "5.9.0",
"version": "5.9.3",
"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.6",
"@testing-library/react-native": "^7.0.2",
"@types/react": "^16.9.51",
"@types/react-native": "^0.63.25",
"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",

View File

@@ -30,7 +30,7 @@ export default function useWindowDimensions() {
Dimensions.addEventListener('change', onChange);
return () => Dimensions.addEventListener('change', onChange);
return () => Dimensions.removeEventListener('change', onChange);
}, []);
return dimensions;

View File

@@ -205,6 +205,7 @@ const styles = StyleSheet.create({
},
label: {
marginRight: 32,
flex: 1,
},
button: {
display: 'flex',

View File

@@ -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;
@@ -83,7 +83,7 @@ export default function DrawerView({
minSwipeDistance,
sceneContainerStyle,
}: Props) {
const [loaded, setLoaded] = React.useState([state.index]);
const [loaded, setLoaded] = React.useState([state.routes[state.index].key]);
const dimensions = useWindowDimensions();
const { colors } = useTheme();
@@ -129,8 +129,10 @@ export default function DrawerView({
return () => subscription?.remove();
}, [handleDrawerClose, isDrawerOpen, navigation, state.key]);
if (!loaded.includes(state.index)) {
setLoaded([...loaded, state.index]);
const focusedRouteKey = state.routes[state.index].key;
if (!loaded.includes(focusedRouteKey)) {
setLoaded([...loaded, focusedRouteKey]);
}
const renderNavigationView = ({ progress }: any) => {
@@ -159,7 +161,7 @@ export default function DrawerView({
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
return null;
}

View File

@@ -3,6 +3,30 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [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)
**Note:** Version bump only for package @react-navigation/material-bottom-tabs

View File

@@ -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/).

View File

@@ -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.19",
"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.6",
"@testing-library/react-native": "^7.0.2",
"@types/react": "^16.9.51",
"@types/react-native": "^0.63.25",
"@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",

View File

@@ -3,6 +3,30 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [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)
**Note:** Version bump only for package @react-navigation/material-top-tabs

View File

@@ -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/).

View File

@@ -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.19",
"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.6",
"@testing-library/react-native": "^7.0.2",
"@types/react": "^16.9.51",
"@types/react-native": "^0.63.25",
"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-tab-view": "^2.15.1",
"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-tab-view": "^2.15.2",
"typescript": "^4.0.3"
},
"peerDependencies": {
"@react-navigation/native": "^5.0.5",

View File

@@ -3,6 +3,36 @@
All notable changes to this project will be documented in this file.
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)

View File

@@ -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/).

View File

@@ -1,7 +1,7 @@
{
"name": "@react-navigation/native",
"description": "React Native integration for React Navigation",
"version": "5.7.3",
"version": "5.7.6",
"keywords": [
"react-native",
"react-navigation",
@@ -37,20 +37,20 @@
"clean": "del lib"
},
"dependencies": {
"@react-navigation/core": "^5.12.3",
"@react-navigation/core": "^5.12.5",
"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.51",
"@types/react-dom": "^16.9.8",
"@types/react-native": "^0.63.4",
"@types/react-native": "^0.63.25",
"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": "*",

View File

@@ -423,13 +423,16 @@ export default function useLinking(
// 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
const state = ref.current.getRootState();
const path = getPathFromStateRef.current(state, configRef.current);
if (previousStateRef.current === undefined) {
previousStateRef.current = state;
if (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 () => {

View File

@@ -3,19 +3,15 @@ import * as React from 'react';
export default function useThenable<T>(create: () => PromiseLike<T>) {
const [promise] = React.useState(create);
// Check if our thenable is synchronous
let resolved = false;
let value: T | undefined;
let initialState: [boolean, T | undefined] = [false, undefined];
// Check if our thenable is synchronous
promise.then((result) => {
resolved = true;
value = result;
initialState = [true, result];
});
const [state, setState] = React.useState<[boolean, T | undefined]>([
resolved,
value,
]);
const [state, setState] = React.useState(initialState);
const [resolved] = state;
React.useEffect(() => {
let cancelled = false;

View File

@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [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

View File

@@ -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/).

View File

@@ -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",

View File

@@ -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] } };

View File

@@ -3,6 +3,33 @@
All notable changes to this project will be documented in this file.
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)

View File

@@ -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/).

View File

@@ -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.3",
"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.6",
"@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.51",
"@types/react-native": "^0.63.25",
"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",

View File

@@ -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

View File

@@ -21,6 +21,7 @@ export default function HeaderTitle({ tintColor, style, ...rest }: Props) {
return (
<Animated.Text
accessibilityRole="header"
aria-level="1"
numberOfLines={1}
{...rest}
style={[

View File

@@ -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

7327
yarn.lock

File diff suppressed because it is too large Load Diff