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( - + );