react-native-event-listeners icon indicating copy to clipboard operation
react-native-event-listeners copied to clipboard

Dose't work with pressable

Open Coolister-Ye opened this issue 1 year ago • 0 comments

Below is a minimal repo, it seems this project cannot work with Pressable. When I click in Pressable, console.log didn't print anything.

import { Pressable, TouchableWithoutFeedback, View, Text } from "react-native";
import { EventRegister } from "react-native-event-listeners";

export default function EventProvider({ children }) {

    return (
        <TouchableWithoutFeedback className="flex-1" onPress={(e) => { 
            console.log(e.target);
            EventRegister.emit('pressOutside', e); 
        }}>
            <Pressable>
                 <Text>Click Here</Text>
            </Pressable>
            <View className="flex-1">
                {children}
            </View>
        </TouchableWithoutFeedback>
    )
}

Coolister-Ye avatar Jul 24 '24 12:07 Coolister-Ye