1
Answer

Close button in react native

selvi jp

selvi jp

3y
636
1

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)