Javascript – Why useEffect is triggered when I use a function from props (function is not changing)?
The Main component is calling a Modal/Dialog. [...] const closeDialog = () => setIsOpenDialog(false); return ( <MyDialog isOpen={isOpenDialog} onClose={closeDialog} /> ); The MyDialog code is: [...] useEffect(() => { console.log('This removes dialog states (data)!') }, [onClose]); export default function MyDialog({…