[[oktatas:web:react|< React]] ====== React - Bootstrap ====== * **Szerző:** Sallai András * Copyright (c) Sallai András, 2022, 2023 * Licenc: [[https://creativecommons.org/licenses/by-sa/4.0/|CC Attribution-Share Alike 4.0 International]] * Web: https://szit.hu ===== react-bootstrap ===== ==== Importálás ==== npm install react-bootstrap bootstrap ==== Webhelyek ==== * https://react-bootstrap.github.io/ * https://create-react-app.dev/ ==== Háromszög területszámítás ==== import './App.css'; import { useState } from "react"; import 'bootstrap/dist/css/bootstrap.min.css'; import Button from 'react-bootstrap/Button'; function App() { const [base, setBase] = useState(); const [height, setHeight] = useState(""); const [area, setArea] = useState(""); function calcTriangleArea() { let area = base * height / 2 setArea(area) } return (

Háromszög területe

setBase(e.target.value)} className='form-control'/>
setHeight(e.target.value)} className='form-control'/>
); } export default App;
label { width: 100px; } input { margin-bottom: 3px !important; } ===== Bootstrap ===== import './App.css'; import 'bootstrap/dist/css/bootstrap.css'; function App() { return (
Valami
); } export default App;