React feladat (2024. 12. 16. + 2024. 12. 17.)
This commit is contained in:
14
2024. 12. 10/test/src/Kaka.js
Normal file
14
2024. 12. 10/test/src/Kaka.js
Normal file
@@ -0,0 +1,14 @@
|
||||
import React, { use } from "react";
|
||||
import { useState } from "react";
|
||||
|
||||
function Kaka() {
|
||||
let [gyumolcs, setGyumolcs] = useState("barack")
|
||||
return (
|
||||
<>
|
||||
<p>{gyumolcs}</p>
|
||||
<button onClick={() => setGyumolcs("kaka")}>Csá fasz</button>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
export default Kaka
|
||||
@@ -3,13 +3,15 @@ import ReactDOM from 'react-dom/client';
|
||||
import './index.css';
|
||||
// import App from './App';
|
||||
import Auto from "./Auto"
|
||||
import Kaka from "./Kaka"
|
||||
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(
|
||||
<React.StrictMode>
|
||||
<Auto auto1={auto1} auto2={auto2}/>
|
||||
{/* <Auto auto1={auto1} auto2={auto2}/> */}
|
||||
<Kaka />
|
||||
</React.StrictMode>
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user