supermedium / aframe-react

:atom: Build virtual reality experiences with A-Frame and React.
https://ngokevin.github.io/aframe-react-boilerplate/
MIT License
1.42k stars 151 forks source link

Why is this image being loaded both by react and then by frame? #138

Open rvanderspuy opened 4 years ago

rvanderspuy commented 4 years ago

Hello!

I noticed some odd behaviour. When I'm loading a particular image, "SI.jpg" in the attached screenshot, I've noticed both react and aframe make independent requests to load it. Does anyone have any idea why this might be happening?

Screenshot 2020-03-30 at 11 12 50

(The image is requested in an <a-assets> <img> tag)

rvanderspuy commented 4 years ago

There's this bit of code in a-frame core:

https://github.com/aframevr/aframe/blob/a8b7ddcd13990596730d390269ec9256dd1c9ba3/src/core/a-assets.js#L180

I wonder if it's because the element is cloned if crossorigin is not set? And so two load requests are sent (one for the original, and then another for the clone)?