0.0.5 • Published 6 years ago

usewhy v0.0.5

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

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);} />
  )
}
0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago