Я пытаюсь создать шаблон объекта, используя компонент aframe-state:
<a-entity layout = "type: circle; radius: 10" bind-for = "for: guidePreview; in: guidePreviews; key: id">
<template>
<a-entity draw = "width:256; height: 256" guidepreview = "{{guidePreview}}" bind = "data: guidePreview"></a-entity>
</template>
</a-entity>
я получил
You are attempting to attach outside of an A-Frame scene. Append this element to
<a-scene>instead. aframe-master.js:58249 Uncaught TypeError: parentEl.emit is not a functionat HTMLElement.value (aframe-master.js:58249) at HTMLElement.value (aframe-master.js:58112) at HTMLElement.wrappedMethod (aframe-master.js:59621) at HTMLElement.value (aframe-master.js:58246) at HTMLElement.value (aframe-master.js:58112) at HTMLElement.wrappedMethod (aframe-master.js:59621) at NewComponent.renderItems (aframe-state-component.js:953) at NewComponent.<anonymous> (aframe-state-component.js:932)
Это внутри сцены, однако это также внутри компонента React (который мне нужен для определения доступа и маршрутизации).
Является ли причиной того, что шаблон добавляется за пределы сцены из-за React?
Можете ли вы поделиться фрагментом <a-scene>, чтобы показать, как используется компонент?





Работает ли это вне React? Не знаю, портит ли это дело.