react-three-fiber

Switching the default renderer

If you want to exchange the default renderer you can. Here's a small example.

import { render, unmountComponentAtNode } from "react-three-fiber";
const renderer = new THREE.SVGRenderer();
renderer.setSize(window.innerWidth, window.innerHeight);
document.body.appendChild(renderer.domElement);
const camera = new THREE.PerspectiveCamera(
75,
window.innerWidth / window.innerHeight,
0.1,
1000
);
const scene = new THREE.Scene();
render(
<mesh>
<sphereGeometry name="geometry" args={[1, 16, 16]} />
<meshBasicMaterial name="material" />
</mesh>,
scene
);
Edit this page on GitHub