0.0.5 • Published 6 years ago
usewhy v0.0.5
useWhy
Watch React hook dependencies and report which dependency caused the hook to fire.
Usage
import useWhy from 'usewhy';
function YourComponent(props) {
const [name, setName] = useState("");
useEffect(
() => {
console.log('hello world!', name);
},
useWhy([name])
);
return (
<input type="text" onChange={(e) => setState(e.target.value);} />
)
}