Skip to content

Instantly share code, notes, and snippets.

@misss-popcorn
Created October 25, 2020 15:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save misss-popcorn/67b10c24a2f0ef11512db76cd81ebce6 to your computer and use it in GitHub Desktop.
Save misss-popcorn/67b10c24a2f0ef11512db76cd81ebce6 to your computer and use it in GitHub Desktop.
import React, {useState, useEffect} from "react";
export function UseEffectFunc() {
const [name,
setName] = useState("Maria");
useEffect(() => {
document.title = name;
});
const handleChange = (e) => {
setName(e.target.value);
};
return (
<span className="Right">
<p>Function Component</p>
<input value={name} onChange={handleChange}></input>
</span>
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment