score:1

Accepted answer
const ProductDetailsComponent = ({ triggered }) => {
  const oldTriggerRef = React.useRef(0);
  React.useEffect(() => {
    if (triggered !== oldTriggerRef.current) {
      oldTriggerRef.current = triggered;
      console.log('HELO');
    }
  }, [triggered]);

  return <div>Child</div>;
};

Related Query

More Query from same tag