Compare commits

..

4 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
24 changed files with 728 additions and 554 deletions

View File

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

View File

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

View File

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

View File

@@ -1,7 +1,7 @@
{
"name": "@react-navigation/bottom-tabs",
"description": "Bottom tab navigator following iOS design guidelines",
"version": "5.9.1",
"version": "5.9.2",
"keywords": [
"react-native-component",
"react-component",
@@ -41,11 +41,11 @@
},
"devDependencies": {
"@react-native-community/bob": "^0.16.2",
"@react-navigation/native": "^5.7.5",
"@react-navigation/native": "^5.7.6",
"@testing-library/react-native": "^7.0.2",
"@types/color": "^3.0.1",
"@types/react": "^16.9.49",
"@types/react-native": "^0.63.20",
"@types/react": "^16.9.51",
"@types/react-native": "^0.63.25",
"del-cli": "^3.0.1",
"react": "~16.13.1",
"react-native": "~0.63.2",

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

View File

@@ -1,7 +1,7 @@
{
"name": "@react-navigation/compat",
"description": "Compatibility layer to write navigator definitions in static configuration format",
"version": "5.2.7",
"version": "5.2.8",
"license": "MIT",
"repository": {
"type": "git",
@@ -32,8 +32,8 @@
},
"devDependencies": {
"@react-native-community/bob": "^0.16.2",
"@react-navigation/native": "^5.7.5",
"@types/react": "^16.9.49",
"@react-navigation/native": "^5.7.6",
"@types/react": "^16.9.51",
"react": "~16.13.1",
"typescript": "^4.0.3"
},

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

View File

@@ -1,7 +1,7 @@
{
"name": "@react-navigation/core",
"description": "Core utilities for building navigators",
"version": "5.12.4",
"version": "5.12.5",
"keywords": [
"react",
"react-native",
@@ -38,14 +38,14 @@
"@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.2",
"@types/react": "^16.9.49",
"@types/react": "^16.9.51",
"@types/react-is": "^16.7.1",
"@types/use-subscription": "^1.0.0",
"del-cli": "^3.0.1",

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

View File

@@ -1,7 +1,7 @@
{
"name": "@react-navigation/devtools",
"description": "Developer tools for React Navigation",
"version": "5.1.6",
"version": "5.1.7",
"keywords": [
"react",
"react-native",
@@ -36,14 +36,14 @@
"clean": "del lib"
},
"dependencies": {
"@react-navigation/core": "^5.12.4",
"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.2",
"@types/deep-equal": "^1.0.1",
"@types/react": "^16.9.49",
"@types/react": "^16.9.51",
"del-cli": "^3.0.1",
"react": "~16.13.1",
"typescript": "^4.0.3"

View File

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

View File

@@ -1,7 +1,7 @@
{
"name": "@react-navigation/drawer",
"description": "Drawer navigator component with animated transitions and gesturess",
"version": "5.9.2",
"version": "5.9.3",
"keywords": [
"react-native-component",
"react-component",
@@ -46,10 +46,10 @@
},
"devDependencies": {
"@react-native-community/bob": "^0.16.2",
"@react-navigation/native": "^5.7.5",
"@react-navigation/native": "^5.7.6",
"@testing-library/react-native": "^7.0.2",
"@types/react": "^16.9.49",
"@types/react-native": "^0.63.20",
"@types/react": "^16.9.51",
"@types/react-native": "^0.63.25",
"del-cli": "^3.0.1",
"react": "~16.13.1",
"react-native": "~0.63.2",

View File

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

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.18",
"version": "5.2.19",
"keywords": [
"react-native-component",
"react-component",
@@ -42,10 +42,10 @@
},
"devDependencies": {
"@react-native-community/bob": "^0.16.2",
"@react-navigation/native": "^5.7.5",
"@react-navigation/native": "^5.7.6",
"@testing-library/react-native": "^7.0.2",
"@types/react": "^16.9.49",
"@types/react-native": "^0.63.20",
"@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.13.1",

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

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

View File

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

View File

@@ -1,7 +1,7 @@
{
"name": "@react-navigation/native",
"description": "React Native integration for React Navigation",
"version": "5.7.5",
"version": "5.7.6",
"keywords": [
"react-native",
"react-navigation",
@@ -37,15 +37,15 @@
"clean": "del lib"
},
"dependencies": {
"@react-navigation/core": "^5.12.4",
"@react-navigation/core": "^5.12.5",
"nanoid": "^3.1.12"
},
"devDependencies": {
"@react-native-community/bob": "^0.16.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-native": "^0.63.20",
"@types/react-native": "^0.63.25",
"del-cli": "^3.0.1",
"react": "~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
// 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,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.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

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

1068
yarn.lock

File diff suppressed because it is too large Load Diff