I have a react-three-scene where this line joins two cubes. I can move the cubes using TransformControls.
<Line
points={[
[pos1.x, pos1.y, pos1.z],
[pos2.x, pos2.y, pos2.z],
]}
ref={addToPathRefs}
/>
I want that the points of this line dynamically modify as I move the cubes. I cannot use state because there can be any number of cubes in that scene.