leva icon indicating copy to clipboard operation
leva copied to clipboard

Hiden a specific panel

Open quangArchiviet opened this issue 2 years ago • 1 comments

Hi everyone,

I facing a problem while trying to use Leva as a controller for meshes.

I have an array of mesh ... and, I want to control it with Leva. Each mesh will be rendered as a component via map

meshes.map((item, index) => <ComponentUseLevaInside isShowLeva={true} />

The problem here, I will have multiple Leva panels showing on the screen ... but I just want to show 1 panel at a time (via the isShowLeva prop).

I don't know how to hide the Leva panel ...

Screen Shot 2023-04-10 at 18 25 54 Screen Shot 2023-04-10 at 18 26 14

quangArchiviet avatar Apr 10 '23 11:04 quangArchiviet

Do you have to render every ComponentUseLevaInside?

Assuming each child has their own useControls() statement inside of it, could you just use a React switch to determine which child to render?

benz2012 avatar May 07 '23 16:05 benz2012