aframevr / aframe

:a: Web framework for building virtual reality experiences.
https://aframe.io/
MIT License
16.61k stars 3.94k forks source link

light="defaultLightsEnabled: false" is ignored on second load #4858

Open bknill opened 3 years ago

bknill commented 3 years ago

Description:

I have both existing lights and the above added to the scene element.

Works the first time (no other lights) the second time the scene loads (it's in a react app but removed and then loaded again ) the above is ignored and the lights are added.

bknill commented 3 years ago

For anyone else you can remove them manually with this

    this.lights = document.querySelectorAll("[data-aframe-default-light]")
    if(Array.from(this.lights)?.length)
        Array.from(this.lights).map(el => this.el.sceneEl.removeChild(el))
dmarcos commented 3 years ago

Can you reproduce without react? Can you provide a link with a simple example? Glitch recommended https://glitch.com/~aframe