Сделали изменение заголовка

This commit is contained in:
2026-04-28 21:08:23 +03:00
parent 102da1ad75
commit 91a6340078
3 changed files with 546 additions and 85 deletions
+22
View File
@@ -1,6 +1,7 @@
import styles from './App.module.scss'
import SneakersImage from './assets/images/sneakers-image.jpg'
import { FaRegUser } from 'react-icons/fa'
import React from 'react'
function Header() {
const handleChange = event => {
@@ -27,6 +28,26 @@ function Product() {
console.log('Working!')
}
function Counter() {
const [title,setTitle] = React.useState('');
const [titleValue,setTitleValue] = React.useState({
title:'',
});
console.log(titleValue);
return (
<>
<input
value={title}
type="text"
onChange={e => setTitle(e.target.value)}
/>
<button onClick={setTitleValue(title)}>Установить заголовок</button>
</>
)
}
return (
<div className={styles.product}>
<img src={SneakersImage} alt='' />
@@ -38,6 +59,7 @@ function Product() {
<p className={styles.description}>NIKE</p>
<p className={styles.price}>$38.00</p>
</div>
<Counter />
</div>
)
}