mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-01-14 17:42:29 +08:00
Compare commits
4 Commits
@react-nav
...
@react-nav
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
35747a6066 | ||
|
|
bae4019995 | ||
|
|
d3a9639060 | ||
|
|
d88cbcb52d |
@@ -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.4](https://github.com/react-navigation/react-navigation/compare/@react-navigation/bottom-tabs@5.11.3...@react-navigation/bottom-tabs@5.11.4) (2021-01-21)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* fix drawer and bottom tabs not being visible on web. closes [#9225](https://github.com/react-navigation/react-navigation/issues/9225) ([d88cbcb](https://github.com/react-navigation/react-navigation/commit/d88cbcb52d46de26edaa9ce6bfb06badb1b1de64))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## [5.11.3](https://github.com/react-navigation/react-navigation/compare/@react-navigation/bottom-tabs@5.11.2...@react-navigation/bottom-tabs@5.11.3) (2021-01-14)
|
## [5.11.3](https://github.com/react-navigation/react-navigation/compare/@react-navigation/bottom-tabs@5.11.2...@react-navigation/bottom-tabs@5.11.3) (2021-01-14)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -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.11.3",
|
"version": "5.11.4",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"react-native-component",
|
"react-native-component",
|
||||||
"react-component",
|
"react-component",
|
||||||
@@ -40,7 +40,7 @@
|
|||||||
"react-native-iphone-x-helper": "^1.3.0"
|
"react-native-iphone-x-helper": "^1.3.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@react-navigation/native": "^5.9.0",
|
"@react-navigation/native": "^5.9.1",
|
||||||
"@testing-library/react-native": "^7.1.0",
|
"@testing-library/react-native": "^7.1.0",
|
||||||
"@types/color": "^3.0.1",
|
"@types/color": "^3.0.1",
|
||||||
"@types/react": "^16.9.53",
|
"@types/react": "^16.9.53",
|
||||||
|
|||||||
@@ -142,51 +142,49 @@ export default class BottomTabView extends React.Component<Props, State> {
|
|||||||
return (
|
return (
|
||||||
<NavigationHelpersContext.Provider value={navigation}>
|
<NavigationHelpersContext.Provider value={navigation}>
|
||||||
<SafeAreaProviderCompat>
|
<SafeAreaProviderCompat>
|
||||||
<View style={styles.container}>
|
<ScreenContainer
|
||||||
<ScreenContainer
|
// @ts-ignore
|
||||||
// @ts-ignore
|
enabled={detachInactiveScreens}
|
||||||
enabled={detachInactiveScreens}
|
style={styles.container}
|
||||||
style={styles.pages}
|
>
|
||||||
>
|
{routes.map((route, index) => {
|
||||||
{routes.map((route, index) => {
|
const descriptor = descriptors[route.key];
|
||||||
const descriptor = descriptors[route.key];
|
const { unmountOnBlur } = descriptor.options;
|
||||||
const { unmountOnBlur } = descriptor.options;
|
const isFocused = state.index === index;
|
||||||
const isFocused = state.index === index;
|
|
||||||
|
|
||||||
if (unmountOnBlur && !isFocused) {
|
if (unmountOnBlur && !isFocused) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lazy && !loaded.includes(route.key) && !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;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ResourceSavingScene
|
<ResourceSavingScene
|
||||||
key={route.key}
|
key={route.key}
|
||||||
style={StyleSheet.absoluteFill}
|
style={StyleSheet.absoluteFill}
|
||||||
isVisible={isFocused}
|
isVisible={isFocused}
|
||||||
enabled={detachInactiveScreens}
|
enabled={detachInactiveScreens}
|
||||||
|
>
|
||||||
|
<SceneContent
|
||||||
|
isFocused={isFocused}
|
||||||
|
style={sceneContainerStyle}
|
||||||
>
|
>
|
||||||
<SceneContent
|
<BottomTabBarHeightContext.Provider value={tabBarHeight}>
|
||||||
isFocused={isFocused}
|
{descriptor.render()}
|
||||||
style={sceneContainerStyle}
|
</BottomTabBarHeightContext.Provider>
|
||||||
>
|
</SceneContent>
|
||||||
<BottomTabBarHeightContext.Provider value={tabBarHeight}>
|
</ResourceSavingScene>
|
||||||
{descriptor.render()}
|
);
|
||||||
</BottomTabBarHeightContext.Provider>
|
})}
|
||||||
</SceneContent>
|
</ScreenContainer>
|
||||||
</ResourceSavingScene>
|
<BottomTabBarHeightCallbackContext.Provider
|
||||||
);
|
value={this.handleTabBarHeightChange}
|
||||||
})}
|
>
|
||||||
</ScreenContainer>
|
{this.renderTabBar()}
|
||||||
<BottomTabBarHeightCallbackContext.Provider
|
</BottomTabBarHeightCallbackContext.Provider>
|
||||||
value={this.handleTabBarHeightChange}
|
|
||||||
>
|
|
||||||
{this.renderTabBar()}
|
|
||||||
</BottomTabBarHeightCallbackContext.Provider>
|
|
||||||
</View>
|
|
||||||
</SafeAreaProviderCompat>
|
</SafeAreaProviderCompat>
|
||||||
</NavigationHelpersContext.Provider>
|
</NavigationHelpersContext.Provider>
|
||||||
);
|
);
|
||||||
@@ -198,9 +196,6 @@ const styles = StyleSheet.create({
|
|||||||
flex: 1,
|
flex: 1,
|
||||||
overflow: 'hidden',
|
overflow: 'hidden',
|
||||||
},
|
},
|
||||||
pages: {
|
|
||||||
flex: 1,
|
|
||||||
},
|
|
||||||
content: {
|
content: {
|
||||||
flex: 1,
|
flex: 1,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -41,32 +41,35 @@ export default function ResourceSavingScene({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
if (Platform.OS === 'web') {
|
||||||
<View
|
return (
|
||||||
// @ts-expect-error: hidden exists on web, but not in React Native
|
|
||||||
hidden={!isVisible}
|
|
||||||
style={[
|
|
||||||
styles.container,
|
|
||||||
Platform.OS === 'web' ? { display: isVisible ? 'flex' : 'none' } : null,
|
|
||||||
style,
|
|
||||||
]}
|
|
||||||
collapsable={false}
|
|
||||||
removeClippedSubviews={
|
|
||||||
// On iOS, set removeClippedSubviews to true only when not focused
|
|
||||||
// This is an workaround for a bug where the clipped view never re-appears
|
|
||||||
Platform.OS === 'ios' ? !isVisible : true
|
|
||||||
}
|
|
||||||
pointerEvents={isVisible ? 'auto' : 'none'}
|
|
||||||
{...rest}
|
|
||||||
>
|
|
||||||
<View
|
<View
|
||||||
style={
|
// @ts-expect-error: hidden exists on web, but not in React Native
|
||||||
Platform.OS === 'web'
|
hidden={!isVisible}
|
||||||
? null
|
style={[
|
||||||
: isVisible
|
{ display: isVisible ? 'flex' : 'none' },
|
||||||
? styles.attached
|
styles.container,
|
||||||
: styles.detached
|
style,
|
||||||
|
]}
|
||||||
|
pointerEvents={isVisible ? 'auto' : 'none'}
|
||||||
|
{...rest}
|
||||||
|
>
|
||||||
|
{children}
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<View style={[styles.container, style]}>
|
||||||
|
<View
|
||||||
|
collapsable={false}
|
||||||
|
removeClippedSubviews={
|
||||||
|
// On iOS, set removeClippedSubviews to true only when not focused
|
||||||
|
// This is an workaround for a bug where the clipped view never re-appears
|
||||||
|
Platform.OS === 'ios' ? !isVisible : true
|
||||||
}
|
}
|
||||||
|
pointerEvents={isVisible ? 'auto' : 'none'}
|
||||||
|
style={isVisible ? styles.attached : styles.detached}
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
</View>
|
</View>
|
||||||
|
|||||||
@@ -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.3.12](https://github.com/react-navigation/react-navigation/compare/@react-navigation/compat@5.3.11...@react-navigation/compat@5.3.12) (2021-01-21)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @react-navigation/compat
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## [5.3.11](https://github.com/react-navigation/react-navigation/compare/@react-navigation/compat@5.3.10...@react-navigation/compat@5.3.11) (2021-01-14)
|
## [5.3.11](https://github.com/react-navigation/react-navigation/compare/@react-navigation/compat@5.3.10...@react-navigation/compat@5.3.11) (2021-01-14)
|
||||||
|
|
||||||
**Note:** Version bump only for package @react-navigation/compat
|
**Note:** Version bump only for package @react-navigation/compat
|
||||||
|
|||||||
@@ -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.3.11",
|
"version": "5.3.12",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
@@ -31,7 +31,7 @@
|
|||||||
"clean": "del lib"
|
"clean": "del lib"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@react-navigation/native": "^5.9.0",
|
"@react-navigation/native": "^5.9.1",
|
||||||
"@types/react": "^16.9.53",
|
"@types/react": "^16.9.53",
|
||||||
"react": "~16.13.1",
|
"react": "~16.13.1",
|
||||||
"react-native-builder-bob": "^0.17.0",
|
"react-native-builder-bob": "^0.17.0",
|
||||||
|
|||||||
@@ -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.15.1](https://github.com/react-navigation/react-navigation/compare/@react-navigation/core@5.15.0...@react-navigation/core@5.15.1) (2021-01-21)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @react-navigation/core
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# [5.15.0](https://github.com/react-navigation/react-navigation/compare/@react-navigation/core@5.14.4...@react-navigation/core@5.15.0) (2021-01-14)
|
# [5.15.0](https://github.com/react-navigation/react-navigation/compare/@react-navigation/core@5.14.4...@react-navigation/core@5.15.0) (2021-01-14)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -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.15.0",
|
"version": "5.15.1",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"react",
|
"react",
|
||||||
"react-native",
|
"react-native",
|
||||||
@@ -35,7 +35,7 @@
|
|||||||
"clean": "del lib"
|
"clean": "del lib"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@react-navigation/routers": "^5.7.0",
|
"@react-navigation/routers": "^5.7.1",
|
||||||
"escape-string-regexp": "^4.0.0",
|
"escape-string-regexp": "^4.0.0",
|
||||||
"nanoid": "^3.1.15",
|
"nanoid": "^3.1.15",
|
||||||
"query-string": "^6.13.6",
|
"query-string": "^6.13.6",
|
||||||
|
|||||||
@@ -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.20](https://github.com/react-navigation/react-navigation/compare/@react-navigation/devtools@5.1.19...@react-navigation/devtools@5.1.20) (2021-01-21)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @react-navigation/devtools
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## [5.1.19](https://github.com/react-navigation/react-navigation/compare/@react-navigation/devtools@5.1.18...@react-navigation/devtools@5.1.19) (2021-01-14)
|
## [5.1.19](https://github.com/react-navigation/react-navigation/compare/@react-navigation/devtools@5.1.18...@react-navigation/devtools@5.1.19) (2021-01-14)
|
||||||
|
|
||||||
**Note:** Version bump only for package @react-navigation/devtools
|
**Note:** Version bump only for package @react-navigation/devtools
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@react-navigation/devtools",
|
"name": "@react-navigation/devtools",
|
||||||
"description": "Developer tools for React Navigation",
|
"description": "Developer tools for React Navigation",
|
||||||
"version": "5.1.19",
|
"version": "5.1.20",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"react",
|
"react",
|
||||||
"react-native",
|
"react-native",
|
||||||
@@ -36,7 +36,7 @@
|
|||||||
"clean": "del lib"
|
"clean": "del lib"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@react-navigation/core": "^5.15.0",
|
"@react-navigation/core": "^5.15.1",
|
||||||
"deep-equal": "^2.0.4"
|
"deep-equal": "^2.0.4"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|||||||
@@ -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.12.0](https://github.com/react-navigation/react-navigation/compare/@react-navigation/drawer@5.11.5...@react-navigation/drawer@5.12.0) (2021-01-21)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* fix drawer and bottom tabs not being visible on web. closes [#9225](https://github.com/react-navigation/react-navigation/issues/9225) ([d88cbcb](https://github.com/react-navigation/react-navigation/commit/d88cbcb52d46de26edaa9ce6bfb06badb1b1de64))
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* add pressColor and pressOpacity props to drawerItem ([#8834](https://github.com/react-navigation/react-navigation/issues/8834)) ([bae4019](https://github.com/react-navigation/react-navigation/commit/bae4019995062c682f0213c121b7927ab8006c1e))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## [5.11.5](https://github.com/react-navigation/react-navigation/compare/@react-navigation/drawer@5.11.4...@react-navigation/drawer@5.11.5) (2021-01-14)
|
## [5.11.5](https://github.com/react-navigation/react-navigation/compare/@react-navigation/drawer@5.11.4...@react-navigation/drawer@5.11.5) (2021-01-14)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -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.11.5",
|
"version": "5.12.0",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"react-native-component",
|
"react-native-component",
|
||||||
"react-component",
|
"react-component",
|
||||||
@@ -45,7 +45,7 @@
|
|||||||
"react-native-iphone-x-helper": "^1.3.0"
|
"react-native-iphone-x-helper": "^1.3.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@react-navigation/native": "^5.9.0",
|
"@react-navigation/native": "^5.9.1",
|
||||||
"@testing-library/react-native": "^7.1.0",
|
"@testing-library/react-native": "^7.1.0",
|
||||||
"@types/react": "^16.9.53",
|
"@types/react": "^16.9.53",
|
||||||
"@types/react-native": "^0.63.30",
|
"@types/react-native": "^0.63.30",
|
||||||
|
|||||||
@@ -56,6 +56,20 @@ type Props = {
|
|||||||
* Background color for item when its inactive.
|
* Background color for item when its inactive.
|
||||||
*/
|
*/
|
||||||
inactiveBackgroundColor?: string;
|
inactiveBackgroundColor?: string;
|
||||||
|
/**
|
||||||
|
* Color of the touchable effect on press.
|
||||||
|
* Only supported on Android.
|
||||||
|
*
|
||||||
|
* @platform android
|
||||||
|
*/
|
||||||
|
pressColor?: string;
|
||||||
|
/**
|
||||||
|
* Opacity of the touchable effect on press.
|
||||||
|
* Only supported on iOS.
|
||||||
|
*
|
||||||
|
* @platform ios
|
||||||
|
*/
|
||||||
|
pressOpacity?: string;
|
||||||
/**
|
/**
|
||||||
* Style object for the label element.
|
* Style object for the label element.
|
||||||
*/
|
*/
|
||||||
@@ -132,6 +146,8 @@ export default function DrawerItem(props: Props) {
|
|||||||
inactiveBackgroundColor = 'transparent',
|
inactiveBackgroundColor = 'transparent',
|
||||||
style,
|
style,
|
||||||
onPress,
|
onPress,
|
||||||
|
pressColor,
|
||||||
|
pressOpacity,
|
||||||
...rest
|
...rest
|
||||||
} = props;
|
} = props;
|
||||||
|
|
||||||
@@ -159,6 +175,8 @@ export default function DrawerItem(props: Props) {
|
|||||||
accessibilityState={{ selected: focused }}
|
accessibilityState={{ selected: focused }}
|
||||||
// @ts-expect-error: keep for compatibility with older React Native versions
|
// @ts-expect-error: keep for compatibility with older React Native versions
|
||||||
accessibilityStates={focused ? ['selected'] : []}
|
accessibilityStates={focused ? ['selected'] : []}
|
||||||
|
pressColor={pressColor}
|
||||||
|
pressOpacity={pressOpacity}
|
||||||
to={to}
|
to={to}
|
||||||
>
|
>
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
|
|||||||
@@ -41,34 +41,35 @@ export default function ResourceSavingScene({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
if (Platform.OS === 'web') {
|
||||||
<View
|
return (
|
||||||
// @ts-expect-error: hidden exists on web, but not in React Native
|
|
||||||
hidden={!isVisible}
|
|
||||||
style={[
|
|
||||||
styles.container,
|
|
||||||
Platform.OS === 'web'
|
|
||||||
? { display: isVisible ? 'flex' : 'none' }
|
|
||||||
: { overflow: 'hidden' },
|
|
||||||
style,
|
|
||||||
]}
|
|
||||||
collapsable={false}
|
|
||||||
removeClippedSubviews={
|
|
||||||
// On iOS, set removeClippedSubviews to true only when not focused
|
|
||||||
// This is an workaround for a bug where the clipped view never re-appears
|
|
||||||
Platform.OS === 'ios' ? !isVisible : true
|
|
||||||
}
|
|
||||||
pointerEvents={isVisible ? 'auto' : 'none'}
|
|
||||||
{...rest}
|
|
||||||
>
|
|
||||||
<View
|
<View
|
||||||
style={
|
// @ts-expect-error: hidden exists on web, but not in React Native
|
||||||
Platform.OS === 'web'
|
hidden={!isVisible}
|
||||||
? null
|
style={[
|
||||||
: isVisible
|
{ display: isVisible ? 'flex' : 'none' },
|
||||||
? styles.attached
|
styles.container,
|
||||||
: styles.detached
|
style,
|
||||||
|
]}
|
||||||
|
pointerEvents={isVisible ? 'auto' : 'none'}
|
||||||
|
{...rest}
|
||||||
|
>
|
||||||
|
{children}
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<View style={[styles.container, style]}>
|
||||||
|
<View
|
||||||
|
collapsable={false}
|
||||||
|
removeClippedSubviews={
|
||||||
|
// On iOS, set removeClippedSubviews to true only when not focused
|
||||||
|
// This is an workaround for a bug where the clipped view never re-appears
|
||||||
|
Platform.OS === 'ios' ? !isVisible : true
|
||||||
}
|
}
|
||||||
|
pointerEvents={isVisible ? 'auto' : 'none'}
|
||||||
|
style={isVisible ? styles.attached : styles.detached}
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
</View>
|
</View>
|
||||||
|
|||||||
@@ -5,14 +5,14 @@ import { BaseButton } from 'react-native-gesture-handler';
|
|||||||
const AnimatedBaseButton = Animated.createAnimatedComponent(BaseButton);
|
const AnimatedBaseButton = Animated.createAnimatedComponent(BaseButton);
|
||||||
|
|
||||||
type Props = React.ComponentProps<typeof BaseButton> & {
|
type Props = React.ComponentProps<typeof BaseButton> & {
|
||||||
activeOpacity: number;
|
pressOpacity: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
const useNativeDriver = Platform.OS !== 'web';
|
const useNativeDriver = Platform.OS !== 'web';
|
||||||
|
|
||||||
export default class TouchableItem extends React.Component<Props> {
|
export default class TouchableItem extends React.Component<Props> {
|
||||||
static defaultProps = {
|
static defaultProps = {
|
||||||
activeOpacity: 0.3,
|
pressOpacity: 0.3,
|
||||||
borderless: true,
|
borderless: true,
|
||||||
enabled: true,
|
enabled: true,
|
||||||
};
|
};
|
||||||
@@ -27,7 +27,7 @@ export default class TouchableItem extends React.Component<Props> {
|
|||||||
overshootClamping: true,
|
overshootClamping: true,
|
||||||
restDisplacementThreshold: 0.01,
|
restDisplacementThreshold: 0.01,
|
||||||
restSpeedThreshold: 0.01,
|
restSpeedThreshold: 0.01,
|
||||||
toValue: active ? this.props.activeOpacity : 1,
|
toValue: active ? this.props.pressOpacity : 1,
|
||||||
useNativeDriver,
|
useNativeDriver,
|
||||||
}).start();
|
}).start();
|
||||||
|
|
||||||
|
|||||||
@@ -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.3.12](https://github.com/react-navigation/react-navigation/compare/@react-navigation/material-bottom-tabs@5.3.11...@react-navigation/material-bottom-tabs@5.3.12) (2021-01-21)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @react-navigation/material-bottom-tabs
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## [5.3.11](https://github.com/react-navigation/react-navigation/compare/@react-navigation/material-bottom-tabs@5.3.10...@react-navigation/material-bottom-tabs@5.3.11) (2021-01-14)
|
## [5.3.11](https://github.com/react-navigation/react-navigation/compare/@react-navigation/material-bottom-tabs@5.3.10...@react-navigation/material-bottom-tabs@5.3.11) (2021-01-14)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -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.3.11",
|
"version": "5.3.12",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"react-native-component",
|
"react-native-component",
|
||||||
"react-component",
|
"react-component",
|
||||||
@@ -41,7 +41,7 @@
|
|||||||
"clean": "del lib"
|
"clean": "del lib"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@react-navigation/native": "^5.9.0",
|
"@react-navigation/native": "^5.9.1",
|
||||||
"@testing-library/react-native": "^7.1.0",
|
"@testing-library/react-native": "^7.1.0",
|
||||||
"@types/react": "^16.9.53",
|
"@types/react": "^16.9.53",
|
||||||
"@types/react-native": "^0.63.30",
|
"@types/react-native": "^0.63.30",
|
||||||
|
|||||||
@@ -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.3.12](https://github.com/react-navigation/react-navigation/compare/@react-navigation/material-top-tabs@5.3.11...@react-navigation/material-top-tabs@5.3.12) (2021-01-21)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @react-navigation/material-top-tabs
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## [5.3.11](https://github.com/react-navigation/react-navigation/compare/@react-navigation/material-top-tabs@5.3.10...@react-navigation/material-top-tabs@5.3.11) (2021-01-14)
|
## [5.3.11](https://github.com/react-navigation/react-navigation/compare/@react-navigation/material-top-tabs@5.3.10...@react-navigation/material-top-tabs@5.3.11) (2021-01-14)
|
||||||
|
|
||||||
**Note:** Version bump only for package @react-navigation/material-top-tabs
|
**Note:** Version bump only for package @react-navigation/material-top-tabs
|
||||||
|
|||||||
@@ -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.3.11",
|
"version": "5.3.12",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"react-native-component",
|
"react-native-component",
|
||||||
"react-component",
|
"react-component",
|
||||||
@@ -44,7 +44,7 @@
|
|||||||
"color": "^3.1.3"
|
"color": "^3.1.3"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@react-navigation/native": "^5.9.0",
|
"@react-navigation/native": "^5.9.1",
|
||||||
"@testing-library/react-native": "^7.1.0",
|
"@testing-library/react-native": "^7.1.0",
|
||||||
"@types/react": "^16.9.53",
|
"@types/react": "^16.9.53",
|
||||||
"@types/react-native": "^0.63.30",
|
"@types/react-native": "^0.63.30",
|
||||||
|
|||||||
@@ -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.9.1](https://github.com/react-navigation/react-navigation/compare/@react-navigation/native@5.9.0...@react-navigation/native@5.9.1) (2021-01-21)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @react-navigation/native
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# [5.9.0](https://github.com/react-navigation/react-navigation/compare/@react-navigation/native@5.8.10...@react-navigation/native@5.9.0) (2021-01-14)
|
# [5.9.0](https://github.com/react-navigation/react-navigation/compare/@react-navigation/native@5.8.10...@react-navigation/native@5.9.0) (2021-01-14)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -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.9.0",
|
"version": "5.9.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.15.0",
|
"@react-navigation/core": "^5.15.1",
|
||||||
"escape-string-regexp": "^4.0.0",
|
"escape-string-regexp": "^4.0.0",
|
||||||
"nanoid": "^3.1.15"
|
"nanoid": "^3.1.15"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -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.7.1](https://github.com/react-navigation/react-navigation/compare/@react-navigation/routers@5.7.0...@react-navigation/routers@5.7.1) (2021-01-21)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* fix StackRouter incorrectly handling invalid route if key is present ([d3a9639](https://github.com/react-navigation/react-navigation/commit/d3a9639060631b06551daf0eac191ec1a442e298))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# [5.7.0](https://github.com/react-navigation/react-navigation/compare/@react-navigation/routers@5.6.2...@react-navigation/routers@5.7.0) (2021-01-14)
|
# [5.7.0](https://github.com/react-navigation/react-navigation/compare/@react-navigation/routers@5.6.2...@react-navigation/routers@5.7.0) (2021-01-14)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@react-navigation/routers",
|
"name": "@react-navigation/routers",
|
||||||
"description": "Routers to help build custom navigators",
|
"description": "Routers to help build custom navigators",
|
||||||
"version": "5.7.0",
|
"version": "5.7.1",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"react",
|
"react",
|
||||||
"react-native",
|
"react-native",
|
||||||
|
|||||||
@@ -349,10 +349,13 @@ export default function StackRouter(options: StackRouterOptions) {
|
|||||||
|
|
||||||
case 'NAVIGATE':
|
case 'NAVIGATE':
|
||||||
if (
|
if (
|
||||||
action.payload.key ||
|
action.payload.name !== undefined &&
|
||||||
(action.payload.name &&
|
!state.routeNames.includes(action.payload.name)
|
||||||
state.routeNames.includes(action.payload.name))
|
|
||||||
) {
|
) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (action.payload.key || action.payload.name) {
|
||||||
// If the route already exists, navigate to that
|
// If the route already exists, navigate to that
|
||||||
let index = -1;
|
let index = -1;
|
||||||
|
|
||||||
|
|||||||
@@ -440,6 +440,55 @@ it('handles navigate action', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("doesn't navigate to nonexistent screen", () => {
|
||||||
|
const router = StackRouter({});
|
||||||
|
const options: RouterConfigOptions = {
|
||||||
|
routeNames: ['baz', 'bar', 'qux'],
|
||||||
|
routeParamList: {},
|
||||||
|
routeGetIdList: {},
|
||||||
|
};
|
||||||
|
|
||||||
|
expect(
|
||||||
|
router.getStateForAction(
|
||||||
|
{
|
||||||
|
stale: false,
|
||||||
|
type: 'stack',
|
||||||
|
key: 'root',
|
||||||
|
index: 1,
|
||||||
|
routeNames: ['baz', 'bar', 'qux'],
|
||||||
|
routes: [
|
||||||
|
{ key: 'baz', name: 'baz' },
|
||||||
|
{ key: 'bar', name: 'bar' },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
CommonActions.navigate('far', { answer: 42 }),
|
||||||
|
options
|
||||||
|
)
|
||||||
|
).toBe(null);
|
||||||
|
|
||||||
|
expect(
|
||||||
|
router.getStateForAction(
|
||||||
|
{
|
||||||
|
stale: false,
|
||||||
|
type: 'stack',
|
||||||
|
key: 'root',
|
||||||
|
index: 1,
|
||||||
|
routeNames: ['baz', 'bar', 'qux'],
|
||||||
|
routes: [
|
||||||
|
{ key: 'baz', name: 'baz' },
|
||||||
|
{ key: 'bar', name: 'bar' },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
CommonActions.navigate({
|
||||||
|
name: 'far',
|
||||||
|
key: 'test',
|
||||||
|
params: { answer: 42 },
|
||||||
|
}),
|
||||||
|
options
|
||||||
|
)
|
||||||
|
).toBe(null);
|
||||||
|
});
|
||||||
|
|
||||||
it('ensures unique ID for navigate', () => {
|
it('ensures unique ID for navigate', () => {
|
||||||
const router = StackRouter({});
|
const router = StackRouter({});
|
||||||
const options: RouterConfigOptions = {
|
const options: RouterConfigOptions = {
|
||||||
@@ -1045,6 +1094,58 @@ it('handles push action', () => {
|
|||||||
).toBe(null);
|
).toBe(null);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("doesn't push nonexistent screen", () => {
|
||||||
|
const router = StackRouter({});
|
||||||
|
const options: RouterConfigOptions = {
|
||||||
|
routeNames: ['baz', 'bar', 'qux'],
|
||||||
|
routeParamList: {},
|
||||||
|
routeGetIdList: {},
|
||||||
|
};
|
||||||
|
|
||||||
|
expect(
|
||||||
|
router.getStateForAction(
|
||||||
|
{
|
||||||
|
stale: false,
|
||||||
|
type: 'stack',
|
||||||
|
key: 'root',
|
||||||
|
index: 1,
|
||||||
|
routeNames: ['baz', 'bar', 'qux'],
|
||||||
|
routes: [
|
||||||
|
{ key: 'baz', name: 'baz' },
|
||||||
|
{ key: 'bar', name: 'bar' },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
StackActions.push('far', { answer: 42 }),
|
||||||
|
options
|
||||||
|
)
|
||||||
|
).toBe(null);
|
||||||
|
|
||||||
|
expect(
|
||||||
|
router.getStateForAction(
|
||||||
|
{
|
||||||
|
stale: false,
|
||||||
|
type: 'stack',
|
||||||
|
key: 'root',
|
||||||
|
index: 1,
|
||||||
|
routeNames: ['baz', 'bar', 'qux'],
|
||||||
|
routes: [
|
||||||
|
{ key: 'baz', name: 'baz' },
|
||||||
|
{ key: 'bar', name: 'bar' },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'PUSH',
|
||||||
|
payload: {
|
||||||
|
name: 'far',
|
||||||
|
key: 'test',
|
||||||
|
params: { answer: 42 },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
options
|
||||||
|
)
|
||||||
|
).toBe(null);
|
||||||
|
});
|
||||||
|
|
||||||
it('ensures unique ID for push', () => {
|
it('ensures unique ID for push', () => {
|
||||||
const router = StackRouter({});
|
const router = StackRouter({});
|
||||||
const options: RouterConfigOptions = {
|
const options: RouterConfigOptions = {
|
||||||
|
|||||||
@@ -708,6 +708,57 @@ it('handles navigate action', () => {
|
|||||||
).toBe(null);
|
).toBe(null);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("doesn't navigate to nonexistent screen", () => {
|
||||||
|
const router = TabRouter({});
|
||||||
|
const options: RouterConfigOptions = {
|
||||||
|
routeNames: ['baz', 'bar'],
|
||||||
|
routeParamList: {},
|
||||||
|
routeGetIdList: {},
|
||||||
|
};
|
||||||
|
|
||||||
|
expect(
|
||||||
|
router.getStateForAction(
|
||||||
|
{
|
||||||
|
stale: false,
|
||||||
|
type: 'tab',
|
||||||
|
key: 'root',
|
||||||
|
index: 1,
|
||||||
|
routeNames: ['baz', 'bar'],
|
||||||
|
routes: [
|
||||||
|
{ key: 'baz', name: 'baz' },
|
||||||
|
{ key: 'bar', name: 'bar' },
|
||||||
|
],
|
||||||
|
history: [{ type: 'route', key: 'bar' }],
|
||||||
|
},
|
||||||
|
CommonActions.navigate('foo', { answer: 42 }),
|
||||||
|
options
|
||||||
|
)
|
||||||
|
).toBe(null);
|
||||||
|
|
||||||
|
expect(
|
||||||
|
router.getStateForAction(
|
||||||
|
{
|
||||||
|
stale: false,
|
||||||
|
type: 'tab',
|
||||||
|
key: 'root',
|
||||||
|
index: 1,
|
||||||
|
routeNames: ['baz', 'bar'],
|
||||||
|
routes: [
|
||||||
|
{ key: 'baz', name: 'baz' },
|
||||||
|
{ key: 'bar', name: 'bar' },
|
||||||
|
],
|
||||||
|
history: [{ type: 'route', key: 'bar' }],
|
||||||
|
},
|
||||||
|
CommonActions.navigate({
|
||||||
|
name: 'foo',
|
||||||
|
key: 'test',
|
||||||
|
params: { answer: 42 },
|
||||||
|
}),
|
||||||
|
options
|
||||||
|
)
|
||||||
|
).toBe(null);
|
||||||
|
});
|
||||||
|
|
||||||
it('handles jump to action', () => {
|
it('handles jump to action', () => {
|
||||||
const router = TabRouter({});
|
const router = TabRouter({});
|
||||||
const options: RouterConfigOptions = {
|
const options: RouterConfigOptions = {
|
||||||
@@ -750,6 +801,34 @@ it('handles jump to action', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("doesn't jump to nonexistent screen", () => {
|
||||||
|
const router = TabRouter({});
|
||||||
|
const options: RouterConfigOptions = {
|
||||||
|
routeNames: ['baz', 'bar'],
|
||||||
|
routeParamList: {},
|
||||||
|
routeGetIdList: {},
|
||||||
|
};
|
||||||
|
|
||||||
|
expect(
|
||||||
|
router.getStateForAction(
|
||||||
|
{
|
||||||
|
stale: false,
|
||||||
|
type: 'tab',
|
||||||
|
key: 'root',
|
||||||
|
index: 1,
|
||||||
|
routeNames: ['baz', 'bar'],
|
||||||
|
routes: [
|
||||||
|
{ key: 'baz', name: 'baz' },
|
||||||
|
{ key: 'bar', name: 'bar' },
|
||||||
|
],
|
||||||
|
history: [{ type: 'route', key: 'bar' }],
|
||||||
|
},
|
||||||
|
TabActions.jumpTo('foo', { answer: 42 }),
|
||||||
|
options
|
||||||
|
)
|
||||||
|
).toBe(null);
|
||||||
|
});
|
||||||
|
|
||||||
it('handles back action with backBehavior: history', () => {
|
it('handles back action with backBehavior: history', () => {
|
||||||
const router = TabRouter({ backBehavior: 'history' });
|
const router = TabRouter({ backBehavior: 'history' });
|
||||||
const options: RouterConfigOptions = {
|
const options: RouterConfigOptions = {
|
||||||
|
|||||||
@@ -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.14.0](https://github.com/react-navigation/react-navigation/compare/@react-navigation/stack@5.13.0...@react-navigation/stack@5.14.0) (2021-01-21)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* add pressColor and pressOpacity props to drawerItem ([#8834](https://github.com/react-navigation/react-navigation/issues/8834)) ([bae4019](https://github.com/react-navigation/react-navigation/commit/bae4019995062c682f0213c121b7927ab8006c1e))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# [5.13.0](https://github.com/react-navigation/react-navigation/compare/@react-navigation/stack@5.12.8...@react-navigation/stack@5.13.0) (2021-01-14)
|
# [5.13.0](https://github.com/react-navigation/react-navigation/compare/@react-navigation/stack@5.12.8...@react-navigation/stack@5.13.0) (2021-01-14)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -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.13.0",
|
"version": "5.14.0",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"react-native-component",
|
"react-native-component",
|
||||||
"react-component",
|
"react-component",
|
||||||
@@ -45,7 +45,7 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@react-native-community/masked-view": "^0.1.10",
|
"@react-native-community/masked-view": "^0.1.10",
|
||||||
"@react-navigation/native": "^5.9.0",
|
"@react-navigation/native": "^5.9.1",
|
||||||
"@testing-library/react-native": "^7.1.0",
|
"@testing-library/react-native": "^7.1.0",
|
||||||
"@types/color": "^3.0.1",
|
"@types/color": "^3.0.1",
|
||||||
"@types/react": "^16.9.53",
|
"@types/react": "^16.9.53",
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { BaseButton } from 'react-native-gesture-handler';
|
|||||||
const AnimatedBaseButton = Animated.createAnimatedComponent(BaseButton);
|
const AnimatedBaseButton = Animated.createAnimatedComponent(BaseButton);
|
||||||
|
|
||||||
type Props = React.ComponentProps<typeof BaseButton> & {
|
type Props = React.ComponentProps<typeof BaseButton> & {
|
||||||
activeOpacity: number;
|
pressOpacity: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
const useNativeDriver = Platform.OS !== 'web';
|
const useNativeDriver = Platform.OS !== 'web';
|
||||||
@@ -27,7 +27,7 @@ export default class BorderlessButton extends React.Component<Props> {
|
|||||||
overshootClamping: true,
|
overshootClamping: true,
|
||||||
restDisplacementThreshold: 0.01,
|
restDisplacementThreshold: 0.01,
|
||||||
restSpeedThreshold: 0.01,
|
restSpeedThreshold: 0.01,
|
||||||
toValue: active ? this.props.activeOpacity : 1,
|
toValue: active ? this.props.pressOpacity : 1,
|
||||||
useNativeDriver,
|
useNativeDriver,
|
||||||
}).start();
|
}).start();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { BaseButton } from 'react-native-gesture-handler';
|
|||||||
const AnimatedBaseButton = Animated.createAnimatedComponent(BaseButton);
|
const AnimatedBaseButton = Animated.createAnimatedComponent(BaseButton);
|
||||||
|
|
||||||
type Props = React.ComponentProps<typeof BaseButton> & {
|
type Props = React.ComponentProps<typeof BaseButton> & {
|
||||||
activeOpacity: number;
|
pressOpacity: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
const useNativeDriver = Platform.OS !== 'web';
|
const useNativeDriver = Platform.OS !== 'web';
|
||||||
@@ -27,7 +27,7 @@ export default class TouchableItem extends React.Component<Props> {
|
|||||||
overshootClamping: true,
|
overshootClamping: true,
|
||||||
restDisplacementThreshold: 0.01,
|
restDisplacementThreshold: 0.01,
|
||||||
restSpeedThreshold: 0.01,
|
restSpeedThreshold: 0.01,
|
||||||
toValue: active ? this.props.activeOpacity : 1,
|
toValue: active ? this.props.pressOpacity : 1,
|
||||||
useNativeDriver,
|
useNativeDriver,
|
||||||
}).start();
|
}).start();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user