Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6295

how to make a button not work until another React Native TypeScript button is pressed

$
0
0

I need another button to start working after pressing the button. Here is the code->the firs part

import React, {useState} from "react";export const PayButton = () => {    const [hasBeenPressed, setHasBeenPressed] = useState(false)    return (<View><Pressable                    style={styles.button}                    onPress={() => setHasBeenPressed(true)}><View style={styles.allMainPay}><View style={styles.pngphotoBack}><Image style={styles.pngphoto} source={require('../img/googlepay.png')} /></View><Text style={styles.textPay}>GooglePay</Text><CircalChange/></View>      </Pressable></View>)

the second part

import React, {useState} from 'react';export const ModalButton = (hasBeenPressed:any, setHasBeenPressed:any) => {  const [modalVisible, setModalVisible] = useState(false);  const [modalPay, setModalPay] = useState(false);  return (<View><Pressable              disabled={!hasBeenPressed}              style={styles.buttonClose}              onPress={() => setModalPay(true)}><Text style={styles.textStyleClose}>Выбрать</Text></Pressable><View>

I've tried a lot, but nothing works.


Viewing all articles
Browse latest Browse all 6295

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>