pmndrs / pmndrs/react-postprocessing

Bloom refs with TypeScript

Open
#161 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
1.4k
Forks
134
Avg merge
4m
Merged PRs (30d)
4

Description

With the following code:

import type { BloomEffect } from "postprocessing";

import { useFrame } from "@react-three/fiber";
import { Bloom } from "@react-three/postprocessing";
import { useRef } from "react";

const MyBloom = () => {
  const bloom = useRef<typeof BloomEffect | null>(null);
  useFrame((state, delta) => {
    bloom.current.intensity = 2;
  });
  return <Bloom ref={bloom} />
}

I get the following error:

Property 'intensity' does not exist on type 'typeof BloomEffect'.

The code works though - am I doing something wrong or is there an issue with the types?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No file or test is named. Start with the TypeScript types behind the imported Bloom component and BloomEffect ref in the example, then reproduce the reported error in a small TypeScript check. Done means the ref exposes the Bloom instance's intensity property with no runtime behavior change.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, three.js, typescript
Domain
computer-graphics, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.