pmndrs / pmndrs/react-postprocessing
Bloom refs with TypeScript
Open
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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