@@ -2,16 +2,14 @@ import React, { RefObject } from 'react'
22import { Vector2 } from 'three'
33import * as THREE from 'three'
44import { type ReactThreeFiber , type ThreeElement , extend , useThree } from '@react-three/fiber'
5- import type { Effect , BlendFunction } from 'postprocessing'
5+ import type { Effect , Pass , BlendFunction } from 'postprocessing'
66
77export const resolveRef = < T , > ( ref : T | React . RefObject < T > ) =>
88 typeof ref === 'object' && ref != null && 'current' in ref ? ref . current : ref
99
10- export type EffectConstructor = new ( ...args : any [ ] ) => Effect
10+ export type EffectConstructor = new ( ...args : any [ ] ) => Effect | Pass
1111
12- export type EffectProps < T extends EffectConstructor > = ThreeElement <
13- T extends Function ? T [ 'prototype' ] : InstanceType < T >
14- > &
12+ export type EffectProps < T extends EffectConstructor > = ThreeElement < T > &
1513 ConstructorParameters < T > [ 0 ] & {
1614 blendFunction ?: BlendFunction
1715 opacity ?: number
@@ -31,7 +29,7 @@ export const wrapEffect = <T extends EffectConstructor>(effect: T, defaults?: Ef
3129
3230 const camera = useThree ( ( state ) => state . camera )
3331 const args = React . useMemo (
34- ( ) => [ ...( ( defaults ?. args ?? [ ] ) as any [ ] ) , ...( ( props . args ?? [ { ...defaults , ...props } ] ) as any [ ] ) ] ,
32+ ( ) => [ ...( defaults ?. args ?? [ ] ) , ...( props . args ?? [ { ...defaults , ...props } ] ) ] ,
3533 // eslint-disable-next-line react-hooks/exhaustive-deps
3634 [ JSON . stringify ( props ) ]
3735 )
0 commit comments