react-three-fiber
react-three-fiber copied to clipboard
Update Canvas.tsx types and how children is rendered
This change is an attempt to make children "optional" and get rid of types workarounds.
For instance in cases like react-three-next:
export default function Scene({ ...props }) {
return (
<Canvas {...props}
onCreated={(state) => (state.gl.toneMapping = THREE.AgXToneMapping)}
>
{/* @ts-ignore */}
<r3f.Out />
<Preload all />
</Canvas>
)
}
We wouldn't be obliged to put @ts-ignore anymore.