selvi jp

selvi jp

  • NA
  • 323
  • 77.3k

Close button in react native

Sep 29 2021 10:48 AM

Hi,

I want to show some message with close button.But its not close.Can anyone help

const [modalVisible, setModalVisible] = useState(true);

  const togglemodel = () => {

    setModalVisible(false);

      };

  {modalVisible==true?

            <View style={styles.errorimage}>

              

              <Text style={{color: '#9F6000'}}>

              hi

              </Text>

              <TouchableOpacity onPress={togglemodel}>

              <Text style={styles.closebutton}>

               X

              </Text>

              </TouchableOpacity>

            </View>

         :null}


Answers (1)