1This is a formatted version of Komadori's answer
2(https://tinyurl.com/Komadori)
3React is a JavaScript library for building user interfaces.
4It is maintained by Facebook and a community of
5individual developers and companies.
6React can be used as a base in the development of single-page
7or mobile applications.
8
1A JS Library that is considered one of the best frameworks/libraries of JS, Thi is Made by Facebook, If u want check out Clever Programmer, the god of React in Youtube
1function Cart() {
2 const monsteraPrice = 8
3 const [cart, updateCart] = useState(0)
4 const [isOpen, setIsOpen] = useState(false)
5
6 return isOpen ? (
7 <div className='lmj-cart'>
8 <button onClick={() => setIsOpen(false)}>Fermer</button>
9 <h2>Panier</h2>
10 <div>
11 Monstera : {monsteraPrice}€
12 <button onClick={() => updateCart(cart + 1)}>
13 Ajouter
14 </button>
15 </div>
16 <h3>Total : {monsteraPrice * cart}€</h3>
17 </div>
18 ) : (
19 <button onClick={() => setIsOpen(true)}>Ouvrir le Panier</button>
20 )
21}
22