Lines disappear when conditionally rendering multiple views; resizing window brings them back

Here’s the codesandbox for reproduction.

Steps to reproduce:

  1. Observe the visible line in the first view
  2. Click the “Change View” button
  3. Observe the missing line in the second view (line is present in the code)
  4. Resize the application window in any way (i.e making the code panel bigger/smaller)
  5. Observe that the previously missing line is now visible

This behavior continues to happen every time the view is changed (i.e going back to the original view will now have the line missing until window resize). From my testing, lines are the only object that this happens with. Am I going about switching views wrong?

Side note: I don’t know why, but it seems as though the domElement refs for the OrbitControls need to be flipped in order for them to work properly across each view. In my application, I have found that using the yomotsu camera controls fixes this problem. Could be unrelated, but just putting it out there.

Update: I was able to fix my problem by constructing my lines using the base LineSegments instead (Working codesandbox). As for why the drei Line does not work properly, I’m still not sure. I even tried switching my conditional render to a CSS display conditional, but observed similar behavior (see another codesandbox).

TL;DR: Used an alternate method.