import React, { useState, useEffect } from 'react';
export default function PageTitle() {
  const [name, setName] = useState('');
 useEffect(() => {
    document.title = `Hi, ${name}`;
  }, [name]);
  return (
      <p>Use {name} input field below to rename this page!</p>
        onChange={({target}) => setName(target.value)} 
        type='text' />

// now the entrry of great functional componentsw useEffect
downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter