We've found a bug for you!
[0] /Users/user1/Downloads/code/app/src/ShingleViewer.res:10:36-45
[0]
[0] 8 ┆ let make = () => {
[0] 9 ┆ <mesh>
[0] 10 ┆ <sphereBufferGeometry attach="geometry" args={[1.5, 64, 64]} />
[0] 11 ┆ <meshPhysicalMaterial
[0] 12 ┆ attach="material"
[0]
The function applied to this argument has type
This argument cannot be applied with label ~attach
Unhandled Runtime Error
Error: Objects are not valid as a React child (found: object with keys {uuid, name, type, parent, children, up, position, rotation, quaternion, scale, matrix, matrixWorld, matrixAutoUpdate, matrixWorldNeedsUpdate, layers, visible, castShadow, receiveShadow, frustumCulled, renderOrder, animations, userData, geometry, material}). If you meant to render a collection of children, use an array instead.
The way react-three-fiber works is a bit odd. Lowercase JSX desugars as string literals, not identifiers. So at runtime they are actually looking for "mesh" as opposed to THREE.Mesh to know what to create. In order to write the bindings you’d need to do something like:
just to explain what’s going on. this is the fundamental way react works, react-reconciler expects a string type in the createInstance hook which then hands down the created instance. <div/>, <mesh/>, it’s all the same principle. r3f is a renderer, like react-dom.
in r3f’s case, it receives “mesh” and makes that a return new THREE[uppercase(type)]. similar to react-dom, which receives “div” and returns createElement(type). that instance is then received by the reconciler.
Ah %identity externals need to be a function call. Sorry maybe it won’t work here? Tbh I’ve only loosely read the thread and suggested a general tip regarding avoiding Obj.magic