React+babylonjs Use the mouse to draw a line

When react uses the mouse to draw a line segment, press and hold the right mouse button to move. I wanted to draw a line, but the entire movement track is displayed.

Could you post image or code let me know details?

By the way, I give you a demo about drawing line with mouse, but not sure if it can be integrated in react easily. If any question, let me know please.

demo link :