Сделали изменение заголовка
This commit is contained in:
+22
@@ -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>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user