diff --git a/src/App.jsx b/src/App.jsx index e15052d..cf446fa 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -1,21 +1,26 @@ import styles from './styles/App.module.scss' -import React, { useState } from 'react' +import React, { useState, useCallback } from 'react' function Parent() { - const [count,setCount] = useState(0); - //const handleCallback = () => setCount(count + 1) - const increment = React.useCallback(() => setCount(count + 1)); + const names = ['Alex','Bob','Deniel']; + const handleNameClick = useCallback( name => { + alert(`Вы нажали на ${name}`); + },[]); return ( <> -