-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v9 type export coverage #2668
Comments
import { type ThreeElement, extend } from '@react-three/fiber'
declare module '@react-three/fiber' {
interface ThreeElements {
customElement: ThreeElement<typeof CustomElement>
}
}
extend({ CustomElement }) As you pointed out earlier, specific math helpers are missing which don't have an upgrade path. I think we can break up what is now |
Working through this one issue at a time, Next is And then I'm not sure what this was supposed to be doing. ReactThreeFiber.Overwrite<
ReactThreeFiber.Object3DNode<ArcballControlsImpl, typeof ArcballControlsImpl>,
{
target?: ReactThreeFiber.Vector3
camera?: OrthographicCamera | PerspectiveCamera
domElement?: HTMLElement
regress?: boolean
makeDefault?: boolean
onChange?: (e?: Event) => void
onStart?: (e?: Event) => void
onEnd?: (e?: Event) => void
}
> Maybe it is the same as: ThreeElements['object3D'] & { /*props*/ } |
So, digging a little deeper it looks like interface NodeProps<T, P> {
attach?: AttachType;
args?: Args<P>;
children?: React.ReactNode;
ref?: React.RefCallback<T> | React.RefObject<React.ReactNode> | null;
key?: React.Key;
onUpdate?: (self: T) => void;
} |
I'm sorry to keep pilling these up. I believe this is related to the I tried looking through the type code for an answer but I haven't yet mastered TS wizardry to properly read it. It appears to have something to do with export type ThreeElement<T extends ConstructorRepresentation> = Mutable<
Overwrite<ElementProps<T>, Omit<InstanceProps<InstanceType<T>>, 'object'>>
> |
Thanks for the deep analysis. |
I narrowed it down to the |
Events are inferred from a compatible raycast signature, but elements may have overloads. I'm not familiar with them, but I'd like to make optional args compatible if present. react-three-fiber/packages/fiber/src/three-types.ts Lines 30 to 33 in 0df10bb
|
I am now getting this error all over Drei with the latest type merges:
microsoft/TypeScript#40718 I tried upgrading to the latest TypeScript but it didn't help me.
Edit: Turns out any The full error::
|
I was able to fix the above |
One more issue, |
Looking into this tonight, I see the culprit. Euler's set has a string in it: |
Good news is that preliminary testing with #2705 shows |
I did another pass through Drei.
|
More details about the
|
Looks like the big difference in We don't respect that in react-three-fiber/packages/fiber/src/core/hooks.tsx Lines 10 to 17 in 111b4a5
|
I determined the |
@CodyJasonBennett I'm getting this type error when using these versions of packages, any ideas on how I can resolve it?
Looks somewhat similar to this type error mentioned earlier: I'm using these versions of the package: "@react-three/drei": "9.65.5" And you can clone the specific commit that demonstrates this type error here: |
We just need to release another alpha of v9. They've been fixed since on the v9 branch. |
Right, so the type fixes aren't incorporated into the v9 alpha.2 that's available right now on npm? Upgrading from v8 to v9 alpha doesn't seem to resolve the type issues but it does change the type signature.
|
I would not expect an alpha release to work at all and wait until we start rolling beta releases. |
I started a branch to update Drei to use R3F v9. Attached is a log of all the type errors I got, which are mostly along the lines of prop types. I'd like to talk about the best way to handle this in v9, if there is already a strategy I am unaware of or if we should create one.
drei-type-errors.txt
The text was updated successfully, but these errors were encountered: