I need to call this function when the state is changed and use callback for it but it always gets called while dependency is not changed:
const toggle = useCallback(() => { setClose(true) }, [isClosed]);
What is wrong?