I'm using mind ar aframe with react and sometimes when the camera starts this error occurs, including with the example of multi targets.
Here is my code:
import React, { useEffect, useRef } from 'react';
import 'aframe';
import 'aframe-extras';
import 'mind-ar/dist/mindar-image-aframe.prod.js';
I'm using mind ar aframe with react and sometimes when the camera starts this error occurs, including with the example of multi targets.
Here is my code: import React, { useEffect, useRef } from 'react'; import 'aframe'; import 'aframe-extras'; import 'mind-ar/dist/mindar-image-aframe.prod.js';
const ARComponent = () => { const sceneRef = useRef(null);
useEffect(() => { const sceneEl = sceneRef.current; const arSystem = sceneEl.systems["mindar-image-system"]; sceneEl.addEventListener('renderstart', () => { arSystem.start(); // start AR }); return () => { arSystem.stop(); } }, []);
return (
); }
export default ARComponent;
Could you tell me what could be causing this problem?