theatre-js / theatre

Motion design editor for the web
https://www.theatrejs.com
Apache License 2.0
10.86k stars 338 forks source link

Type error on `<PerspectiveCamera/>` component from `@theatre/r3f` #429

Open nhtoby311 opened 11 months ago

nhtoby311 commented 11 months ago

I'm using the <PerspectiveCamera/> component, in a React typescript project, with R3F extension. As I use the component, I receive type error that I need to provide these 3 props as undefined.

<TheatrePerspectiveCamera
  theatreKey='Camera'
  makeDefault
  position={[0, 0, 0]}
  fov={40}
  near={0.1}
  far={70}
  //These props need to be included
  attachArray={undefined}
  attachObject={undefined}
  attachFns={undefined}
/>

I compare between this and drei <PerspectiveCamera/> component type .d.ts file, I found these 3 types are not existed in their package, but have in theatre instead. Three and drei documentation does not mention about these 3 types. Version:

"@react-three/drei": "^9.74.15",
"@react-three/fiber": "^8.13.3",
"@theatre/core": "^0.6.1",
"@theatre/r3f": "^0.6.1",
"@theatre/studio": "^0.6.1",
nhtoby311 commented 11 months ago

I think due to R3F update, this has been changed to attach only. Perhaps update R3F to package would solve the issue? https://docs.pmnd.rs/react-three-fiber/tutorials/v8-migration-guide#unified-attach-api