fin tuto
This commit is contained in:
@@ -1,12 +1,15 @@
|
||||
import "./App.css";
|
||||
import Header from "./components/Header"; // 👈 on IMPORTE le composant
|
||||
import Header from "./components/Header"; //
|
||||
import Footer from "./components/Footer";
|
||||
import Carte from "./components/Carte";
|
||||
import Compteurs from "./components/Compteurs";
|
||||
|
||||
function App() {
|
||||
return (
|
||||
<div>
|
||||
<Header />
|
||||
<Compteurs />
|
||||
|
||||
<Carte titre="Géolocalisation" texte="Suivi en temps réel" />
|
||||
<Carte titre="Consommation" texte="Carburant consommé" />
|
||||
<Footer />
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
import { useState } from "react";
|
||||
|
||||
function Compteur() {
|
||||
const [nombre, setNombre] = useState(0); // valeur de départ : 0
|
||||
|
||||
return (
|
||||
<div>
|
||||
<p>Véhicules : {nombre}</p>
|
||||
<button onClick={() => setNombre(nombre + 1)}>+</button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default Compteur;
|
||||
Reference in New Issue
Block a user