pmndrs / pmndrs/react-postprocessing

Bloom refs with TypeScript

オープン
#161 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
TypeScript
スター
1.4k
フォーク
134
平均マージ
4分
マージ済み PR(30日)
4

説明

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?

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

ファイルもテストも指定されていません。まず、例にあるインポートされた Bloom コンポーネントと BloomEffect ref の背後にある TypeScript 型から始め、次に小さな TypeScript チェックで報告されたエラーを再現します。ref が Bloom インスタンスの intensity プロパティを公開し、実行時の動作が変わらなければ完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
react, three.js, typescript
領域
computer-graphics, frontend
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。