From 888977cca3cff09b74764fb4f8fa56f40e7c4a6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?T=C3=B3th=20=C3=81d=C3=A1m?= Date: Thu, 12 Dec 2024 10:55:57 +0100 Subject: [PATCH] =?UTF-8?q?Frontend=20=C3=B3ra=20(2024.=2012.=2010.)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 2024. 12. 10/test/src/Auto.js | 20 ++++++++++---------- 2024. 12. 10/test/src/index.js | 7 ++++--- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/2024. 12. 10/test/src/Auto.js b/2024. 12. 10/test/src/Auto.js index b17440b..726b580 100644 --- a/2024. 12. 10/test/src/Auto.js +++ b/2024. 12. 10/test/src/Auto.js @@ -1,15 +1,15 @@ import React from "react"; +import { useState } from "react"; -class Auto extends React.Component { - render() { - return ( - <> -

Autó

-

Piros

-
Lada
- - ) - } +function Auto() { + let [szin, setSzin] = useState() + setSzin("szia") + return ( + <> +

Autó tulajdonságok:

+

Az autó színe: {szin}

+ + ) } export default Auto \ No newline at end of file diff --git a/2024. 12. 10/test/src/index.js b/2024. 12. 10/test/src/index.js index dd26d7c..8c155ef 100644 --- a/2024. 12. 10/test/src/index.js +++ b/2024. 12. 10/test/src/index.js @@ -1,14 +1,15 @@ import React from 'react'; import ReactDOM from 'react-dom/client'; import './index.css'; -import App from './App'; +// import App from './App'; import Auto from "./Auto" import reportWebVitals from './reportWebVitals'; - +let auto1 = {szin: "narancs", marka: "Suzuki"} +let auto2 = {szin: "vörös", marka: "Fiat"} const root = ReactDOM.createRoot(document.getElementById('root')); root.render( - + );