Skip to content

Commit

Permalink
fix: drop forwardRef in wrapEffect (#317)
Browse files Browse the repository at this point in the history
  • Loading branch information
CodyJasonBennett authored Jan 17, 2025
1 parent 11e20ac commit d422ccc
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/util.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@ let i = 0
const components = new WeakMap<EffectConstructor, React.ExoticComponent<any> | string>()

export const wrapEffect = <T extends EffectConstructor>(effect: T, defaults?: EffectProps<T>) =>
/* @__PURE__ */ React.forwardRef<T, EffectProps<T>>(function Effect(
{ blendFunction = defaults?.blendFunction, opacity = defaults?.opacity, ...props },
ref
) {
/* @__PURE__ */ function Effect({ blendFunction = defaults?.blendFunction, opacity = defaults?.opacity, ...props }) {
let Component = components.get(effect)
if (!Component) {
const key = `@react-three/postprocessing/${effect.name}-${i++}`
Expand All @@ -45,11 +42,10 @@ export const wrapEffect = <T extends EffectConstructor>(effect: T, defaults?: Ef
blendMode-blendFunction={blendFunction}
blendMode-opacity-value={opacity}
{...props}
ref={ref}
args={args}
/>
)
})
}

export const useVector2 = (props: Record<string, unknown>, key: string): THREE.Vector2 => {
const value = props[key] as ReactThreeFiber.Vector2 | undefined
Expand Down

0 comments on commit d422ccc

Please sign in to comment.