Open jb-san opened 19 hours ago
trying to make a custom renderer like this
<Canvas
style={{ flex: 1, backgroundColor: "black" }}
gl={(canvas) => {
const gl = canvas.getContext("webgl", { antialias: false })!;
const renderer = new THREE.WebGLRenderer({
canvas: {
powerPreference: "high-performance",
antialias: true,
alpha: true,
width: gl.drawingBufferWidth,
height: gl.drawingBufferHeight,
style: {},
addEventListener: (() => {}) as any,
removeEventListener: (() => {}) as any,
clientHeight: gl.drawingBufferHeight,
},
context: gl,
});
renderer.setPixelRatio(1);
renderer.setSize(gl.drawingBufferWidth, gl.drawingBufferHeight);
return renderer;
}}
style={{ flex: 1, backgroundColor: "red" }}
>...
to mimic the way the renderer is created in PureThree.tsx
does not work
Im trying to run @react-three/fiber in a new expo project that is using the new architecture, but it does not show anything and when adding object like lighting it causes threejs to throw
cannot read trim of undefined
it renders on web and android
I created a repro repo here: https://github.com/jb-san/expo-52-three-fiber run:
it has 3 pages
I can get the PureThree.tsx to not render anything if I remove the
style:{}
on line 14