I have a component that calls recursive setTimeout to do random revolve animation. It also starts from a random initial position.
<!-- inside ocean.component.html -->
<app-ship
[badgeUrl]="ship.badgeUrl"
[range]="{width:200, height:200}"
*ngFor="let ship of ships"
></app-ship>
When one of the ship data (ship.badgeUrl) change, I hope it just replace the ship badge image, but it rerender this componet, whick make the revolve animation stop and start from a random position again.
How to prevent the whole component rerender when props change?