From fda0dc216c036d0a2f30c608d9ffc24f2137c284 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kov=C3=A1cs=20Rudolf?= Date: Thu, 17 Sep 2026 10:05:49 +0200 Subject: [PATCH] =?UTF-8?q?React=20alap=20p=C3=A9lda?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- react_alap/app.js | 32 ++++++++++++++++++++++++++++++++ react_alap/index.html | 18 ++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 react_alap/app.js create mode 100644 react_alap/index.html diff --git a/react_alap/app.js b/react_alap/app.js new file mode 100644 index 0000000..fa47fd0 --- /dev/null +++ b/react_alap/app.js @@ -0,0 +1,32 @@ +//Procedurális +const gomb=document.createElement('button'); +gomb.textContent="JS gomb"; +gomb.onclick=function(){ + alert("Js gomb"); +} + +const jsgomb=document.getElementById('jsgomb'); +jsgomb.appendChild(gomb); + + +//Deklaratív + +const rgomb=React.createElement("button",{ + onClick:function(){ + alert("React gomb"); + } +},"React gomb"); + +const kontener=React.createElement('div', + { + style:{ + backgroundColor:"green", + width:"300px", + height:"200px" + } + }, + rgomb,rgomb,rgomb,rgomb,rgomb,rgomb); + + +const root=ReactDOM.createRoot(document.getElementById('reactgomb')); +root.render(kontener); diff --git a/react_alap/index.html b/react_alap/index.html new file mode 100644 index 0000000..d776862 --- /dev/null +++ b/react_alap/index.html @@ -0,0 +1,18 @@ + + + + + + React bevezető + + + + + +

Javascript gomb

+
+

React gomb

+
+ + + \ No newline at end of file