Reactjs – useEffect inside child component, running uneccessarily, every time component is called
I've a parent component and a child component. I'm using array.map() method to call the child component for every value in the messages array. now I want to do something inside the child component every time a button in the…