Button with onhover and function paramter

Man kann eine Funktion als Parameter dem button übergeben, sodass er diese ausführt, sobald auf ihn geklickt wird
This commit is contained in:
brausjonas
2023-04-27 21:59:12 +02:00
parent eb91703cc9
commit 659b6f9112
5 changed files with 91 additions and 64 deletions
+5 -1
View File
@@ -1,10 +1,14 @@
import './App.css';
import Button from "./components/Button";
import {arrowLeft} from "./Icons";
import {arrowRight} from "./Icons";
function App() {
return (
<div className="App">
<Button/>
<Button icon={arrowLeft} iconWidth={50} iconHeight={50} width={200} height={100}/>
<Button text={"Hallo"} onClick={() => {console.log("test")}}></Button>
</div>
);
}