Skip to content

Instantly share code, notes, and snippets.

@brigand
Created June 22, 2021 19:03
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 brigand/d55099ad5244681ac194cb3c4624f0a9 to your computer and use it in GitHub Desktop.
Save brigand/d55099ad5244681ac194cb3c4624f0a9 to your computer and use it in GitHub Desktop.
const Foo = () => {
const foo = useSelector(selectFoo);
const [initial] = useState(foo);
useEffect(() => {
if (foo !== initial) {
console.log('foo');
}
}, [foo]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment