Skip to content

Instantly share code, notes, and snippets.

@brigand
Created Jun 22, 2021
Embed
What would you like to do?
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