Compare commits

...

6 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
25 changed files with 792 additions and 563 deletions

View File

@@ -20,7 +20,7 @@
"expo-asset": "~8.2.0", "expo-asset": "~8.2.0",
"expo-blur": "~8.2.0", "expo-blur": "~8.2.0",
"expo-linking": "^1.0.4", "expo-linking": "^1.0.4",
"expo-updates": "~0.3.3", "expo-updates": "~0.3.5",
"koa": "^2.13.0", "koa": "^2.13.0",
"react": "~16.13.1", "react": "~16.13.1",
"react-dom": "~16.13.1", "react-dom": "~16.13.1",
@@ -31,26 +31,26 @@
"react-native-reanimated": "~1.13.0", "react-native-reanimated": "~1.13.0",
"react-native-safe-area-context": "3.1.4", "react-native-safe-area-context": "3.1.4",
"react-native-screens": "~2.10.1", "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.13.13" "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.4", "@types/koa": "^2.11.4",
"@types/node-fetch": "^2.5.7", "@types/node-fetch": "^2.5.7",
"@types/react": "~16.9.35", "@types/react": "~16.9.51",
"@types/react-dom": "^16.9.8", "@types/react-dom": "^16.9.8",
"@types/react-native": "~0.63.2", "@types/react-native": "~0.63.25",
"babel-loader": "^8.1.0", "babel-loader": "^8.1.0",
"babel-plugin-module-resolver": "^4.0.0", "babel-plugin-module-resolver": "^4.0.0",
"babel-preset-expo": "^8.3.0", "babel-preset-expo": "^8.3.0",
"cheerio": "^1.0.0-rc.3", "cheerio": "^1.0.0-rc.3",
"expo-cli": "^3.27.7", "expo-cli": "^3.27.14",
"jest": "^26.4.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.1", "node-fetch": "^2.6.1",

View File

@@ -27,13 +27,13 @@
"devDependencies": { "devDependencies": {
"@commitlint/config-conventional": "^11.0.0", "@commitlint/config-conventional": "^11.0.0",
"@types/jest": "^26.0.14", "@types/jest": "^26.0.14",
"babel-jest": "^26.3.0", "babel-jest": "^26.5.2",
"codecov": "^3.7.2", "codecov": "^3.8.0",
"commitlint": "^11.0.0", "commitlint": "^11.0.0",
"eslint": "^7.9.0", "eslint": "^7.10.0",
"eslint-config-satya164": "^3.1.8", "eslint-config-satya164": "^3.1.8",
"husky": "^4.3.0", "husky": "^4.3.0",
"jest": "^26.4.2", "jest": "^26.5.2",
"lerna": "^3.22.1", "lerna": "^3.22.1",
"metro-react-native-babel-preset": "^0.63.0", "metro-react-native-babel-preset": "^0.63.0",
"prettier": "^2.1.2", "prettier": "^2.1.2",

View File

@@ -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.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) # [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)

View File

@@ -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.9.0", "version": "5.9.2",
"keywords": [ "keywords": [
"react-native-component", "react-native-component",
"react-component", "react-component",
@@ -41,11 +41,11 @@
}, },
"devDependencies": { "devDependencies": {
"@react-native-community/bob": "^0.16.2", "@react-native-community/bob": "^0.16.2",
"@react-navigation/native": "^5.7.4", "@react-navigation/native": "^5.7.6",
"@testing-library/react-native": "^7.0.2", "@testing-library/react-native": "^7.0.2",
"@types/color": "^3.0.1", "@types/color": "^3.0.1",
"@types/react": "^16.9.49", "@types/react": "^16.9.51",
"@types/react-native": "^0.63.20", "@types/react-native": "^0.63.25",
"del-cli": "^3.0.1", "del-cli": "^3.0.1",
"react": "~16.13.1", "react": "~16.13.1",
"react-native": "~0.63.2", "react-native": "~0.63.2",

View File

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

View File

@@ -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.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) ## [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 **Note:** Version bump only for package @react-navigation/compat

View File

@@ -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.6", "version": "5.2.8",
"license": "MIT", "license": "MIT",
"repository": { "repository": {
"type": "git", "type": "git",
@@ -32,8 +32,8 @@
}, },
"devDependencies": { "devDependencies": {
"@react-native-community/bob": "^0.16.2", "@react-native-community/bob": "^0.16.2",
"@react-navigation/native": "^5.7.4", "@react-navigation/native": "^5.7.6",
"@types/react": "^16.9.49", "@types/react": "^16.9.51",
"react": "~16.13.1", "react": "~16.13.1",
"typescript": "^4.0.3" "typescript": "^4.0.3"
}, },

View File

@@ -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.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) ## [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)

View File

@@ -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.4", "version": "5.12.5",
"keywords": [ "keywords": [
"react", "react",
"react-native", "react-native",
@@ -38,14 +38,14 @@
"@react-navigation/routers": "^5.4.12", "@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.2", "@testing-library/react-native": "^7.0.2",
"@types/react": "^16.9.49", "@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",

View File

@@ -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.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) ## [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 **Note:** Version bump only for package @react-navigation/devtools

View File

@@ -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.6", "version": "5.1.7",
"keywords": [ "keywords": [
"react", "react",
"react-native", "react-native",
@@ -36,14 +36,14 @@
"clean": "del lib" "clean": "del lib"
}, },
"dependencies": { "dependencies": {
"@react-navigation/core": "^5.12.4", "@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.2", "@testing-library/react-native": "^7.0.2",
"@types/deep-equal": "^1.0.1", "@types/deep-equal": "^1.0.1",
"@types/react": "^16.9.49", "@types/react": "^16.9.51",
"del-cli": "^3.0.1", "del-cli": "^3.0.1",
"react": "~16.13.1", "react": "~16.13.1",
"typescript": "^4.0.3" "typescript": "^4.0.3"

View File

@@ -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.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) ## [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)

View File

@@ -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.1", "version": "5.9.3",
"keywords": [ "keywords": [
"react-native-component", "react-native-component",
"react-component", "react-component",
@@ -46,10 +46,10 @@
}, },
"devDependencies": { "devDependencies": {
"@react-native-community/bob": "^0.16.2", "@react-native-community/bob": "^0.16.2",
"@react-navigation/native": "^5.7.4", "@react-navigation/native": "^5.7.6",
"@testing-library/react-native": "^7.0.2", "@testing-library/react-native": "^7.0.2",
"@types/react": "^16.9.49", "@types/react": "^16.9.51",
"@types/react-native": "^0.63.20", "@types/react-native": "^0.63.25",
"del-cli": "^3.0.1", "del-cli": "^3.0.1",
"react": "~16.13.1", "react": "~16.13.1",
"react-native": "~0.63.2", "react-native": "~0.63.2",

View File

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

View File

@@ -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.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) ## [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 **Note:** Version bump only for package @react-navigation/material-bottom-tabs

View File

@@ -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.17", "version": "5.2.19",
"keywords": [ "keywords": [
"react-native-component", "react-native-component",
"react-component", "react-component",
@@ -42,10 +42,10 @@
}, },
"devDependencies": { "devDependencies": {
"@react-native-community/bob": "^0.16.2", "@react-native-community/bob": "^0.16.2",
"@react-navigation/native": "^5.7.4", "@react-navigation/native": "^5.7.6",
"@testing-library/react-native": "^7.0.2", "@testing-library/react-native": "^7.0.2",
"@types/react": "^16.9.49", "@types/react": "^16.9.51",
"@types/react-native": "^0.63.20", "@types/react-native": "^0.63.25",
"@types/react-native-vector-icons": "^6.4.6", "@types/react-native-vector-icons": "^6.4.6",
"del-cli": "^3.0.1", "del-cli": "^3.0.1",
"react": "~16.13.1", "react": "~16.13.1",

View File

@@ -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.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) ## [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 **Note:** Version bump only for package @react-navigation/material-top-tabs

View File

@@ -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.17", "version": "5.2.19",
"keywords": [ "keywords": [
"react-native-component", "react-native-component",
"react-component", "react-component",
@@ -45,16 +45,16 @@
}, },
"devDependencies": { "devDependencies": {
"@react-native-community/bob": "^0.16.2", "@react-native-community/bob": "^0.16.2",
"@react-navigation/native": "^5.7.4", "@react-navigation/native": "^5.7.6",
"@testing-library/react-native": "^7.0.2", "@testing-library/react-native": "^7.0.2",
"@types/react": "^16.9.49", "@types/react": "^16.9.51",
"@types/react-native": "^0.63.20", "@types/react-native": "^0.63.25",
"del-cli": "^3.0.1", "del-cli": "^3.0.1",
"react": "~16.13.1", "react": "~16.13.1",
"react-native": "~0.63.2", "react-native": "~0.63.2",
"react-native-gesture-handler": "~1.7.0", "react-native-gesture-handler": "~1.7.0",
"react-native-reanimated": "~1.13.0", "react-native-reanimated": "~1.13.0",
"react-native-tab-view": "^2.15.1", "react-native-tab-view": "^2.15.2",
"typescript": "^4.0.3" "typescript": "^4.0.3"
}, },
"peerDependencies": { "peerDependencies": {

View File

@@ -3,6 +3,28 @@
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) ## [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 **Note:** Version bump only for package @react-navigation/native

View File

@@ -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.4", "version": "5.7.6",
"keywords": [ "keywords": [
"react-native", "react-native",
"react-navigation", "react-navigation",
@@ -37,15 +37,15 @@
"clean": "del lib" "clean": "del lib"
}, },
"dependencies": { "dependencies": {
"@react-navigation/core": "^5.12.4", "@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.2", "@testing-library/react-native": "^7.0.2",
"@types/react": "^16.9.49", "@types/react": "^16.9.51",
"@types/react-dom": "^16.9.8", "@types/react-dom": "^16.9.8",
"@types/react-native": "^0.63.20", "@types/react-native": "^0.63.25",
"del-cli": "^3.0.1", "del-cli": "^3.0.1",
"react": "~16.13.1", "react": "~16.13.1",
"react-dom": "^16.13.1", "react-dom": "^16.13.1",

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 // 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 () => {

View File

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

View File

@@ -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.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) ## [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)

View File

@@ -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.1", "version": "5.9.3",
"keywords": [ "keywords": [
"react-native-component", "react-native-component",
"react-component", "react-component",
@@ -46,11 +46,11 @@
"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.4", "@react-navigation/native": "^5.7.6",
"@testing-library/react-native": "^7.0.2", "@testing-library/react-native": "^7.0.2",
"@types/color": "^3.0.1", "@types/color": "^3.0.1",
"@types/react": "^16.9.49", "@types/react": "^16.9.51",
"@types/react-native": "^0.63.20", "@types/react-native": "^0.63.25",
"del-cli": "^3.0.1", "del-cli": "^3.0.1",
"react": "~16.13.1", "react": "~16.13.1",
"react-native": "~0.63.2", "react-native": "~0.63.2",

1068
yarn.lock

File diff suppressed because it is too large Load Diff