Cleaning up on entity.remove()?

I have a render component which contains reference to a sprite.
When entity.remove() is called this all works fine but the sprite is left on screen.

Is there a recommended way of calling my cleanup function? I notice in the ECSY code there are internal events fired on entity and component but I wasn’t sure how to hook into them or if there was another way ?

The recommended way is to use System State Components.

This will make you remove the component manually.

Thanks. I somehow missed those! Will have a read.