Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const BasicEffect = () => {
- const [age, setAge] = useState(0)
- const handleClick = () => setAge(age + 1)
- useEffect(() => {
- document.title = 'You are ' + age + ' years old!'
- })
- return <div>
- <p> Look at the title of the current tab in your browser </p>
- <button onClick={handleClick}>Update Title!! </button>
- </div>
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement