Answers for "counter composant react"

0

counter composant react

import React, { useState } from 'react';

function Example() {
  // Déclare une nouvelle variable d'état, que l'on va appeler « count »  const [count, setCount] = useState(0);
  return (
    <div>
      <p>Vous avez cliqué {count} fois</p>
      <button onClick={() => setCount(count + 1)}>
        Cliquez ici
      </button>
    </div>
  );
}
Posted by: Guest on January-11-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language