Compare commits

...

2 Commits

Author SHA1 Message Date
Satyajit Sahoo
2477db47a0 chore: publish
- @react-navigation/bottom-tabs@5.6.1
 - @react-navigation/compat@5.1.28
 - @react-navigation/core@5.11.1
 - @react-navigation/devtools@5.1.1
 - @react-navigation/drawer@5.8.4
 - @react-navigation/material-bottom-tabs@5.2.12
 - @react-navigation/material-top-tabs@5.2.12
 - @react-navigation/native@5.6.1
 - @react-navigation/stack@5.6.2
2020-06-25 17:31:40 +02:00
Satyajit Sahoo
d1210a861b fix: fix error with type definitions. closes #8511 2020-06-25 17:27:48 +02:00
21 changed files with 118 additions and 46 deletions

View File

@@ -1,38 +1,33 @@
import * as React from 'react'; import * as React from 'react';
import { View, Platform, StyleSheet, ScrollView } from 'react-native'; import { View, Platform, StyleSheet, ScrollView } from 'react-native';
import { Button } from 'react-native-paper'; import { Button } from 'react-native-paper';
import type { RouteProp, ParamListBase } from '@react-navigation/native'; import type { ParamListBase } from '@react-navigation/native';
import { import {
createStackNavigator, createStackNavigator,
StackNavigationProp, StackScreenProps,
} from '@react-navigation/stack'; } from '@react-navigation/stack';
import Article from '../Shared/Article'; import Article from '../Shared/Article';
import Albums from '../Shared/Albums'; import Albums from '../Shared/Albums';
import NewsFeed from '../Shared/NewsFeed'; import NewsFeed from '../Shared/NewsFeed';
type SimpleStackParams = { type SimpleStackParams = {
Article: { author: string }; Article: { author: string } | undefined;
NewsFeed: undefined; NewsFeed: { date: number };
Albums: undefined; Albums: undefined;
}; };
type SimpleStackNavigation = StackNavigationProp<SimpleStackParams>;
const scrollEnabled = Platform.select({ web: true, default: false }); const scrollEnabled = Platform.select({ web: true, default: false });
const ArticleScreen = ({ const ArticleScreen = ({
navigation, navigation,
route, route,
}: { }: StackScreenProps<SimpleStackParams, 'Article'>) => {
navigation: SimpleStackNavigation;
route: RouteProp<SimpleStackParams, 'Article'>;
}) => {
return ( return (
<ScrollView> <ScrollView>
<View style={styles.buttons}> <View style={styles.buttons}>
<Button <Button
mode="contained" mode="contained"
onPress={() => navigation.replace('NewsFeed')} onPress={() => navigation.replace('NewsFeed', { date: Date.now() })}
style={styles.button} style={styles.button}
> >
Replace with feed Replace with feed
@@ -46,7 +41,7 @@ const ArticleScreen = ({
</Button> </Button>
</View> </View>
<Article <Article
author={{ name: route.params.author }} author={{ name: route.params?.author ?? 'Unknown' }}
scrollEnabled={scrollEnabled} scrollEnabled={scrollEnabled}
/> />
</ScrollView> </ScrollView>
@@ -54,10 +49,9 @@ const ArticleScreen = ({
}; };
const NewsFeedScreen = ({ const NewsFeedScreen = ({
route,
navigation, navigation,
}: { }: StackScreenProps<SimpleStackParams, 'NewsFeed'>) => {
navigation: SimpleStackNavigation;
}) => {
return ( return (
<ScrollView> <ScrollView>
<View style={styles.buttons}> <View style={styles.buttons}>
@@ -76,16 +70,14 @@ const NewsFeedScreen = ({
Go back Go back
</Button> </Button>
</View> </View>
<NewsFeed scrollEnabled={scrollEnabled} /> <NewsFeed scrollEnabled={scrollEnabled} date={route.params.date} />
</ScrollView> </ScrollView>
); );
}; };
const AlbumsScreen = ({ const AlbumsScreen = ({
navigation, navigation,
}: { }: StackScreenProps<SimpleStackParams, 'Albums'>) => {
navigation: SimpleStackNavigation;
}) => {
return ( return (
<ScrollView> <ScrollView>
<View style={styles.buttons}> <View style={styles.buttons}>
@@ -111,11 +103,9 @@ const AlbumsScreen = ({
const SimpleStack = createStackNavigator<SimpleStackParams>(); const SimpleStack = createStackNavigator<SimpleStackParams>();
type Props = { export default function SimpleStackScreen({
navigation: StackNavigationProp<ParamListBase>; navigation,
}; }: StackScreenProps<ParamListBase>) {
export default function SimpleStackScreen({ navigation }: Props) {
navigation.setOptions({ navigation.setOptions({
headerShown: false, headerShown: false,
}); });
@@ -126,7 +116,7 @@ export default function SimpleStackScreen({ navigation }: Props) {
name="Article" name="Article"
component={ArticleScreen} component={ArticleScreen}
options={({ route }) => ({ options={({ route }) => ({
title: `Article by ${route.params.author}`, title: `Article by ${route.params?.author ?? 'Unknown'}`,
})} })}
initialParams={{ author: 'Gandalf' }} initialParams={{ author: 'Gandalf' }}
/> />

View File

@@ -18,7 +18,9 @@ import {
} from 'react-native-paper'; } from 'react-native-paper';
import Color from 'color'; import Color from 'color';
type Props = Partial<ScrollViewProps>; type Props = Partial<ScrollViewProps> & {
date?: number;
};
const Author = () => { const Author = () => {
return ( return (

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.6.1](https://github.com/react-navigation/react-navigation/compare/@react-navigation/bottom-tabs@5.6.0...@react-navigation/bottom-tabs@5.6.1) (2020-06-25)
**Note:** Version bump only for package @react-navigation/bottom-tabs
# [5.6.0](https://github.com/react-navigation/react-navigation/compare/@react-navigation/bottom-tabs@5.5.2...@react-navigation/bottom-tabs@5.6.0) (2020-06-24) # [5.6.0](https://github.com/react-navigation/react-navigation/compare/@react-navigation/bottom-tabs@5.5.2...@react-navigation/bottom-tabs@5.6.0) (2020-06-24)

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.6.0", "version": "5.6.1",
"keywords": [ "keywords": [
"react-native-component", "react-native-component",
"react-component", "react-component",
@@ -41,7 +41,7 @@
}, },
"devDependencies": { "devDependencies": {
"@react-native-community/bob": "^0.15.1", "@react-native-community/bob": "^0.15.1",
"@react-navigation/native": "^5.6.0", "@react-navigation/native": "^5.6.1",
"@types/color": "^3.0.1", "@types/color": "^3.0.1",
"@types/react": "^16.9.36", "@types/react": "^16.9.36",
"@types/react-native": "^0.62.7", "@types/react-native": "^0.62.7",

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.28](https://github.com/react-navigation/react-navigation/compare/@react-navigation/compat@5.1.27...@react-navigation/compat@5.1.28) (2020-06-25)
**Note:** Version bump only for package @react-navigation/compat
## [5.1.27](https://github.com/react-navigation/react-navigation/compare/@react-navigation/compat@5.1.26...@react-navigation/compat@5.1.27) (2020-06-24) ## [5.1.27](https://github.com/react-navigation/react-navigation/compare/@react-navigation/compat@5.1.26...@react-navigation/compat@5.1.27) (2020-06-24)

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.1.27", "version": "5.1.28",
"license": "MIT", "license": "MIT",
"repository": { "repository": {
"type": "git", "type": "git",
@@ -32,7 +32,7 @@
}, },
"devDependencies": { "devDependencies": {
"@react-native-community/bob": "^0.15.1", "@react-native-community/bob": "^0.15.1",
"@react-navigation/native": "^5.6.0", "@react-navigation/native": "^5.6.1",
"@types/react": "^16.9.36", "@types/react": "^16.9.36",
"react": "~16.9.0", "react": "~16.9.0",
"typescript": "^3.9.5" "typescript": "^3.9.5"

View File

@@ -3,6 +3,17 @@
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.11.1](https://github.com/react-navigation/react-navigation/compare/@react-navigation/core@5.11.0...@react-navigation/core@5.11.1) (2020-06-25)
### Bug Fixes
* fix error with type definitions. closes [#8511](https://github.com/react-navigation/react-navigation/issues/8511) ([d1210a8](https://github.com/react-navigation/react-navigation/commit/d1210a861b37201827c333a5c012c4f0ebd9bb6a))
# [5.11.0](https://github.com/react-navigation/react-navigation/compare/@react-navigation/core@5.10.0...@react-navigation/core@5.11.0) (2020-06-24) # [5.11.0](https://github.com/react-navigation/react-navigation/compare/@react-navigation/core@5.10.0...@react-navigation/core@5.11.0) (2020-06-24)

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.11.0", "version": "5.11.1",
"keywords": [ "keywords": [
"react", "react",
"react-native", "react-native",

View File

@@ -61,7 +61,7 @@ export type EventArg<
preventDefault(): void; preventDefault(): void;
} }
: {}) & : {}) &
(undefined extends Data ? {} : { readonly data: Data }); (undefined extends Data ? { readonly data?: Data } : { readonly data: Data });
export type EventListenerCallback< export type EventListenerCallback<
EventMap extends EventMapBase, EventMap extends EventMapBase,
@@ -108,7 +108,7 @@ export type EventEmitter<EventMap extends EventMapBase> = {
? { canPreventDefault: true } ? { canPreventDefault: true }
: {}) & : {}) &
(undefined extends EventMap[EventName]['data'] (undefined extends EventMap[EventName]['data']
? {} ? { data?: EventMap[EventName]['data'] }
: { data: EventMap[EventName]['data'] }) : { data: EventMap[EventName]['data'] })
): EventArg< ): EventArg<
EventName, EventName,
@@ -276,7 +276,12 @@ export type RouteProp<
RouteName extends keyof ParamList RouteName extends keyof ParamList
> = Omit<Route<Extract<RouteName, string>>, 'params'> & > = Omit<Route<Extract<RouteName, string>>, 'params'> &
(undefined extends ParamList[RouteName] (undefined extends ParamList[RouteName]
? {} ? {
/**
* Params for this route
*/
params?: ParamList[RouteName];
}
: { : {
/** /**
* Params for this route * Params for this route

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.1](https://github.com/react-navigation/react-navigation/compare/@react-navigation/devtools@5.1.0...@react-navigation/devtools@5.1.1) (2020-06-25)
**Note:** Version bump only for package @react-navigation/devtools
# 5.1.0 (2020-06-24) # 5.1.0 (2020-06-24)

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.0", "version": "5.1.1",
"keywords": [ "keywords": [
"react", "react",
"react-native", "react-native",
@@ -36,7 +36,7 @@
"clean": "del lib" "clean": "del lib"
}, },
"dependencies": { "dependencies": {
"@react-navigation/core": "^5.11.0", "@react-navigation/core": "^5.11.1",
"deep-equal": "^2.0.3" "deep-equal": "^2.0.3"
}, },
"devDependencies": { "devDependencies": {

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.8.4](https://github.com/react-navigation/react-navigation/compare/@react-navigation/drawer@5.8.3...@react-navigation/drawer@5.8.4) (2020-06-25)
**Note:** Version bump only for package @react-navigation/drawer
## [5.8.3](https://github.com/react-navigation/react-navigation/compare/@react-navigation/drawer@5.8.2...@react-navigation/drawer@5.8.3) (2020-06-24) ## [5.8.3](https://github.com/react-navigation/react-navigation/compare/@react-navigation/drawer@5.8.2...@react-navigation/drawer@5.8.3) (2020-06-24)

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.8.3", "version": "5.8.4",
"keywords": [ "keywords": [
"react-native-component", "react-native-component",
"react-component", "react-component",
@@ -46,7 +46,7 @@
}, },
"devDependencies": { "devDependencies": {
"@react-native-community/bob": "^0.15.1", "@react-native-community/bob": "^0.15.1",
"@react-navigation/native": "^5.6.0", "@react-navigation/native": "^5.6.1",
"@types/react": "^16.9.36", "@types/react": "^16.9.36",
"@types/react-native": "^0.62.7", "@types/react-native": "^0.62.7",
"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.2.12](https://github.com/react-navigation/react-navigation/compare/@react-navigation/material-bottom-tabs@5.2.11...@react-navigation/material-bottom-tabs@5.2.12) (2020-06-25)
**Note:** Version bump only for package @react-navigation/material-bottom-tabs
## [5.2.11](https://github.com/react-navigation/react-navigation/compare/@react-navigation/material-bottom-tabs@5.2.10...@react-navigation/material-bottom-tabs@5.2.11) (2020-06-24) ## [5.2.11](https://github.com/react-navigation/react-navigation/compare/@react-navigation/material-bottom-tabs@5.2.10...@react-navigation/material-bottom-tabs@5.2.11) (2020-06-24)
**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.11", "version": "5.2.12",
"keywords": [ "keywords": [
"react-native-component", "react-native-component",
"react-component", "react-component",
@@ -42,7 +42,7 @@
}, },
"devDependencies": { "devDependencies": {
"@react-native-community/bob": "^0.15.1", "@react-native-community/bob": "^0.15.1",
"@react-navigation/native": "^5.6.0", "@react-navigation/native": "^5.6.1",
"@types/react": "^16.9.36", "@types/react": "^16.9.36",
"@types/react-native": "^0.62.7", "@types/react-native": "^0.62.7",
"@types/react-native-vector-icons": "^6.4.5", "@types/react-native-vector-icons": "^6.4.5",

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.2.12](https://github.com/react-navigation/react-navigation/compare/@react-navigation/material-top-tabs@5.2.11...@react-navigation/material-top-tabs@5.2.12) (2020-06-25)
**Note:** Version bump only for package @react-navigation/material-top-tabs
## [5.2.11](https://github.com/react-navigation/react-navigation/compare/@react-navigation/material-top-tabs@5.2.10...@react-navigation/material-top-tabs@5.2.11) (2020-06-24) ## [5.2.11](https://github.com/react-navigation/react-navigation/compare/@react-navigation/material-top-tabs@5.2.10...@react-navigation/material-top-tabs@5.2.11) (2020-06-24)
**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.11", "version": "5.2.12",
"keywords": [ "keywords": [
"react-native-component", "react-native-component",
"react-component", "react-component",
@@ -45,7 +45,7 @@
}, },
"devDependencies": { "devDependencies": {
"@react-native-community/bob": "^0.15.1", "@react-native-community/bob": "^0.15.1",
"@react-navigation/native": "^5.6.0", "@react-navigation/native": "^5.6.1",
"@types/react": "^16.9.36", "@types/react": "^16.9.36",
"@types/react-native": "^0.62.7", "@types/react-native": "^0.62.7",
"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.6.1](https://github.com/react-navigation/react-navigation/compare/@react-navigation/native@5.6.0...@react-navigation/native@5.6.1) (2020-06-25)
**Note:** Version bump only for package @react-navigation/native
# [5.6.0](https://github.com/react-navigation/react-navigation/compare/@react-navigation/native@5.5.1...@react-navigation/native@5.6.0) (2020-06-24) # [5.6.0](https://github.com/react-navigation/react-navigation/compare/@react-navigation/native@5.5.1...@react-navigation/native@5.6.0) (2020-06-24)

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.6.0", "version": "5.6.1",
"keywords": [ "keywords": [
"react-native", "react-native",
"react-navigation", "react-navigation",
@@ -37,7 +37,7 @@
"clean": "del lib" "clean": "del lib"
}, },
"dependencies": { "dependencies": {
"@react-navigation/core": "^5.11.0", "@react-navigation/core": "^5.11.1",
"nanoid": "^3.1.9" "nanoid": "^3.1.9"
}, },
"devDependencies": { "devDependencies": {

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.6.2](https://github.com/react-navigation/react-navigation/compare/@react-navigation/stack@5.6.1...@react-navigation/stack@5.6.2) (2020-06-25)
**Note:** Version bump only for package @react-navigation/stack
## [5.6.1](https://github.com/react-navigation/react-navigation/compare/@react-navigation/stack@5.6.0...@react-navigation/stack@5.6.1) (2020-06-25) ## [5.6.1](https://github.com/react-navigation/react-navigation/compare/@react-navigation/stack@5.6.0...@react-navigation/stack@5.6.1) (2020-06-25)

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.6.1", "version": "5.6.2",
"keywords": [ "keywords": [
"react-native-component", "react-native-component",
"react-component", "react-component",
@@ -46,7 +46,7 @@
"devDependencies": { "devDependencies": {
"@react-native-community/bob": "^0.15.1", "@react-native-community/bob": "^0.15.1",
"@react-native-community/masked-view": "^0.1.10", "@react-native-community/masked-view": "^0.1.10",
"@react-navigation/native": "^5.6.0", "@react-navigation/native": "^5.6.1",
"@types/color": "^3.0.1", "@types/color": "^3.0.1",
"@types/react": "^16.9.36", "@types/react": "^16.9.36",
"@types/react-native": "^0.62.7", "@types/react-native": "^0.62.7",