JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://aframe.io/releases/0.8.2/aframe.min.js"></script>
<script src="https://unpkg.com/aframe-aabb-collider-component@^2.2.1/dist/aframe-aabb-collider-component.min.js"></script>
<script>
AFRAME.registerComponent("foo", {
init: function() {
this.el.addEventListener("hitstart", (e) => {
console.log(e)
})
}
})
</script>
<a-scene>
<a-camera foo geometry="primitive: box" aabb-collider="objects: a-box">
</a-camera>
<a-box scale="2 2 2" class="box" color="blue" position="0 1.6 -5" ></a-box>
</a-scene>