Skip to content

Instantly share code, notes, and snippets.

@isacjunior
Last active March 29, 2019 20:00
Show Gist options
  • Save isacjunior/f8a327e27b454794ea7a66a547a70e1c to your computer and use it in GitHub Desktop.
Save isacjunior/f8a327e27b454794ea7a66a547a70e1c to your computer and use it in GitHub Desktop.
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