Last active
March 29, 2019 20:00
-
-
Save isacjunior/f8a327e27b454794ea7a66a547a70e1c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useEffect, useState } from 'react' | |
function DidUpdate() { | |
const [name, setName] = useState('') | |
const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => setName(e.target.value) | |
useEffect(() => { | |
console.log('Eu estou montado ou sofri alteração') | |
}, [name]) | |
return ( | |
<> | |
<input value={name} onChange={handleChange} /> | |
</> | |
) | |
} | |
export default DidUpdate |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment