Skip to content

Native Touchable* not working anymore (1.10.0) #1338

@mrousavy

Description

@mrousavy

Description

Since the 1.10.0 upgrade the Touchable* components are not working anymore on Android, meaning they don't switch states, don't show visual feedback, and don't call onPress events.

Everything is working as expected on iOS.

Screenshots

Steps To Reproduce

  1. Use TouchableOpacity from RNGH in 1.9.0, note how it works
  2. Use TouchableOpacity from RNGH in 1.10.0, note how it doesn't work anymore

Expected behavior

I expect it to work.

Actual behavior

It doesn't work.

Snack or minimal code example

import React from "react";
import "react-native-gesture-handler";
import { Text, View } from "react-native";
import { Navigation } from "react-native-navigation";
import { PressableOpacity } from "./src/common/components/pressables/PressableOpacity"; // <-- that's a RN <Pressable> with opacity effect
import {
  gestureHandlerRootHOC,
  TouchableOpacity,
} from "react-native-gesture-handler";

const App = () => {
  console.log("Re-rendering App...");
  return (
    <View style={{ flex: 1, justifyContent: "center", alignItems: "center" }}>
      <Text>Hello world!</Text>
      <PressableOpacity
        style={{ width: 100, height: 50, backgroundColor: "blue" }}
        onPress={() => console.log("js")}
      />
      <TouchableOpacity
        disabled={false}
        style={{ width: 100, height: 50, backgroundColor: "red" }}
        onPress={() => console.log("rngh")}
      />
    </View>
  );
};

Navigation.registerComponent(
  "Home",
  () => gestureHandlerRootHOC(App),
  () => App
);

Navigation.setRoot({
  root: {
    component: {
      name: "Home",
    },
  },
});

Package versions

  • React: 17.0.1
  • React Native: 0.64.0-rc.3
  • React Native Gesture Handler: 1.10.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions