From 356ef8f789f6b00a069083709e7a40f987198c9f Mon Sep 17 00:00:00 2001 From: Cody Bennett Date: Sat, 16 Sep 2023 20:54:20 -0500 Subject: [PATCH] fix(useLoader): loosen Loader onError signature (#3011) --- packages/fiber/src/core/hooks.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/fiber/src/core/hooks.tsx b/packages/fiber/src/core/hooks.tsx index 8317e09fb4..9adcccf528 100644 --- a/packages/fiber/src/core/hooks.tsx +++ b/packages/fiber/src/core/hooks.tsx @@ -12,7 +12,7 @@ export interface Loader extends THREE.Loader { url: string, onLoad?: (result: T) => void, onProgress?: (event: ProgressEvent) => void, - onError?: (event: ErrorEvent) => void, + onError?: (event: unknown) => void, ): unknown loadAsync(url: string, onProgress?: (event: ProgressEvent) => void): Promise } @@ -101,12 +101,12 @@ function loadingFn>( new Promise((res, reject) => loader.load( input, - (data: any) => { + (data) => { if (data.scene) Object.assign(data, buildGraph(data.scene)) res(data) }, onProgress, - (error) => reject(new Error(`Could not load ${input}: ${error.message}`)), + (error) => reject(new Error(`Could not load ${input}: ${(error as ErrorEvent)?.message}`)), ), ), ),