From ee7445962895a2aa4d65b230947d3fe0f284ef09 Mon Sep 17 00:00:00 2001 From: rodri Date: Wed, 18 Dec 2024 14:22:56 +0000 Subject: [PATCH] fix DREI to work with latest three-sdlib --- src/core/OrbitControls.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/core/OrbitControls.tsx b/src/core/OrbitControls.tsx index bb35a3fc7..d6cbceba5 100644 --- a/src/core/OrbitControls.tsx +++ b/src/core/OrbitControls.tsx @@ -1,12 +1,14 @@ import { EventManager, ReactThreeFiber, useFrame, useThree } from '@react-three/fiber' import * as React from 'react' -import type { Camera, Event, OrthographicCamera, PerspectiveCamera } from 'three' +import { Camera, Event, OrthographicCamera, PerspectiveCamera } from 'three' import { OrbitControls as OrbitControlsImpl } from 'three-stdlib' import { ForwardRefComponent } from '../helpers/ts-utils' -export type OrbitControlsChangeEvent = Event & { - target: EventTarget & { object: Camera } -} +type ExtractCallback = T extends { addEventListener(event: E, callback: infer C): void } + ? C + : never + +export type OrbitControlsChangeEvent = Parameters>[0] export type OrbitControlsProps = Omit< ReactThreeFiber.Overwrite<