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

Every click on addCart appear a new of the same component

$
0
0

I want to everytime i click on "addCart" appear a new of the same component ( another Bets>Example Number</Bets appears on the DOM).

const newBet: React.FC = () => {  const [getAddCart, setGetAddCart] = useState([<BetsEmpty>Empty Cart</BetsEmpty>,  ]);  function addCart() {    setGetAddCart([<Bets>           Example Number</Bets>,    ]);  }return(<AllBets>{getAddCart}</AllBets><Button onClick={addCart}></Button>)}

Viewing all articles
Browse latest Browse all 6287

Trending Articles



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