react-three-fiber icon indicating copy to clipboard operation
react-three-fiber copied to clipboard

Update Canvas.tsx types and how children is rendered

Open joevingracien opened this issue 1 year ago • 1 comments

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.

joevingracien avatar May 13 '24 20:05 joevingracien