ZeroXR is a lightweight React Renderer for WebGL run on WebXR devices
Install
Package module
npm install zeroxr react
HTML script tag:
<script src="https://cdn.jsdelivr.net/npm/react@17.0.2/umd/react.production.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/zeroxr@21.12.24/zeroxr.js"></script>
Example
import { Text, renderXR, requestXR } from 'zeroxr';
const HelloApp = () => {
return (
<Text translation={[0, 0, -1]} text={'Hello World!'} />
);
}
renderXR(<HelloApp />);
document.addEventListener('DOMContentLoaded', (event) => {
document.getElementById("btnEnterXR").onclick = requestXR;
});