Skip to content

Commit e26fd8d

Browse files
committed
[chore] Update changelog and fix lint warnings
1 parent b9a51d9 commit e26fd8d

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# [Unreleased]
22

3+
### Bug Fixes
4+
5+
- Fix double-tap on bottom tab not resetting navigation (V5/6) (#191 thanks @Whichoney)
6+
37
# [3.1.2](https://github.com/IjzerenHein/react-navigation-shared-element/compare/v2.3.0...v3.1.2) (2021-08-19)
48

59
### Features

src/createSharedElementStackNavigator.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
StackActionHelpers,
99
ParamListBase,
1010
StackActions,
11-
EventArg
11+
EventArg,
1212
} from "@react-navigation/native";
1313
import {
1414
CardAnimationContext,
@@ -105,16 +105,16 @@ export default function createSharedElementStackNavigator<
105105

106106
React.useEffect(
107107
() =>
108-
navigation.addListener?.('tabPress', (e) => {
108+
navigation.addListener?.("tabPress", (e) => {
109109
const isFocused = navigation.isFocused();
110-
110+
111111
// Run the operation in the next frame so we're sure all listeners have been run
112112
// This is necessary to know if preventDefault() has been called
113113
requestAnimationFrame(() => {
114114
if (
115115
state.index > 0 &&
116116
isFocused &&
117-
!(e as EventArg<'tabPress', true>).defaultPrevented
117+
!(e as EventArg<"tabPress", true>).defaultPrevented
118118
) {
119119
// When user taps on already focused tab and we're inside the tab,
120120
// reset the stack to replicate native behaviour

0 commit comments

Comments
 (0)