Bonjour,
je suis nouveau dans React, s'il vous plait j'aimerais comprendre pourqui mon code ci-dessous n'affiche rien à l'écran.
c'est mon fichier main.jsx
Merci d'avance pour votre aide.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 import { createRoot, useState } from 'react-dom/client' function Counter() { // Destructuring the array returned by useState const [count, setCount] = useState(0); return ( <button onClick={() => setCount(count + 1)}> Count: {count} </button> ); } createRoot(document.getElementById('root')).render( <Counter /> );
cordialement,
Dibak







Répondre avec citation
Partager