Turn off zappar camera in React+ThreeJS


#1

Hi, can I turn off or deactivate the in my react proyect?


#2

Hi @max.ojeda,

you’re able to toggle it off as so:
<ZapparCamera makeDefault={false} />

If you have a boolean state such as

const [cameraActive, setCameraActive] = useState(true);

you could toggle it back and forth via something like:

<ZapparCamera makeDefault={cameraActive} />
// ...
<div
id="button"
role="button"
onClick={() => { setCameraActive((currentState) => !currentState); }}
>