Skip to content

Question: TouchableOpacity onPress doesn't work #24442

Closed
@AlexMachin1997

Description

@AlexMachin1997

Hi,

I'm experiencing a weird issue with the TouchableOpacity component. When I press the component nothing happens, it should hide the modal but nothing. What makes this more difficult to debug is that I can't debug remotely as the metro bundler just stops working.

This is an incredibly annoying bug, would somebody be able to help me, please.

       <View style={{ flex: 1 }}>
           <View style={{ position: "absolute", right: 0 }}>
             <TouchableOpacity
               onPress={() =>
                 this.setState({
                   error: "",
                   item: {},
                   isAllergicModalVisible: false
                 })
               }
             >
               <MaterialCommunityIcons name="close-circle-outline" size={60} />
             </TouchableOpacity>
           </View>

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions