Skip to content

Commit 575f6ee

Browse files
committed
Rename local var
1 parent 93d71ac commit 575f6ee

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

packages/react-native-gesture-handler/src/components/GestureButtons.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,38 +36,38 @@ class InnerBaseButton extends React.Component<BaseButtonWithRefProps> {
3636
delayLongPress: 600,
3737
};
3838

39-
private lastActive: boolean;
39+
private lastIsPressed: boolean;
4040
private longPressTimeout: ReturnType<typeof setTimeout> | undefined;
4141
private longPressDetected: boolean;
4242

4343
constructor(props: BaseButtonWithRefProps) {
4444
super(props);
45-
this.lastActive = false;
45+
this.lastIsPressed = false;
4646
this.longPressDetected = false;
4747
}
4848

4949
private handleEvent = ({
5050
nativeEvent,
5151
}: HandlerStateChangeEvent<NativeViewGestureHandlerPayload>) => {
5252
const { state, oldState, pointerInside } = nativeEvent;
53-
const active =
53+
const isPressed =
5454
pointerInside && (state === State.BEGAN || state === State.ACTIVE);
5555

56-
if (active !== this.lastActive && this.props.onActiveStateChange) {
57-
this.props.onActiveStateChange(active);
56+
if (isPressed !== this.lastIsPressed && this.props.onActiveStateChange) {
57+
this.props.onActiveStateChange(isPressed);
5858
}
5959

6060
if (
6161
!this.longPressDetected &&
6262
oldState === State.ACTIVE &&
6363
state !== State.CANCELLED &&
64-
this.lastActive &&
64+
this.lastIsPressed &&
6565
this.props.onPress
6666
) {
6767
this.props.onPress(pointerInside);
6868
}
6969

70-
if (!this.lastActive && state === State.BEGAN && pointerInside) {
70+
if (!this.lastIsPressed && state === State.BEGAN && pointerInside) {
7171
this.longPressDetected = false;
7272
if (this.props.onLongPress) {
7373
this.longPressTimeout = setTimeout(
@@ -94,7 +94,7 @@ class InnerBaseButton extends React.Component<BaseButtonWithRefProps> {
9494
this.longPressTimeout = undefined;
9595
}
9696

97-
this.lastActive = active;
97+
this.lastIsPressed = isPressed;
9898
};
9999

100100
private onLongPress = () => {

0 commit comments

Comments
 (0)