I am using react-force-graph-2d and have implemented custom rendering for nodes using rectangles via the nodeCanvasObject callback. However, I'm facing an issue where staining or ghosting appear on the canvas during renders—especially when the graph is animating (i.e., before stabilization).
This behavior typically occurs when I apply custom borders or background fills to the rectangles. The canvas seems to retain trails or stains of previous frames. Once the simulation stabilizes, the stains disappear, and the graph appears normal again.
Any possible fixes for it?