Can I use a “UseEffect” only with a certain value?
问题 Hello I am trying to use a UseEffect of react hooks, I know I can add variables that on change can activate it, but I would like to know if there is a way to activate the useEffect only when the value meets certain criteria. I have already created a conditional inside the useEffect and I know it works, but I would like to know if there's another way to do it. useEffect(() => { doSomething(); if(!isOpen) doSomething2(); }, [isOpen, otherThing]); In the example above I want doSomething2 to work