Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

`Tooltip` is incompatible with callback refs

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

メンテナーはふだん 2 日以内に返信

@AdamMagued がすでに取り組んでいます。

2026年9月29日 から。

  • #8461 @AdamMagued による — オープン

評価

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

調査の方向性

Start at the Tooltip component's ref handling and reproduce the callback-ref example from the issue, comparing it with the object-ref case. Done means a callback ref passed to Tooltip still receives the underlying element and the tooltip appears when hovering the wrapped Button.

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

説明

bug component: Tooltip react
Description

When I encountered https://github.com/primer/react/issues/8373 I moved my callback ref to the wrapping Tooltip . This appeared to forward the ref to the underlying element as I wanted. However, if the passed ref is a callback ref, the tooltip never appears. This is not the case for an object ref.

Steps to reproduce

This breaks, even though it typechecks just fine. The log does get called, but the tooltip does not appear:

const logRef = useCallback(element => console.log(element), [])

return <Tooltip ref={logRef} text="Example"><Button>Button text</Button></Tooltip>

This works, but isn't a callback ref:

const logRef = useRef(null)

return <Tooltip ref={logRef} text="Example"><Button>Button text</Button></Tooltip>

And this shows the tooltip but never calls the log (#8373):

const logRef = useCallback(element => console.log(element), [])

return <Tooltip text="Example"><Button ref={logRef}>Button text</Button></Tooltip>
Version

v38.37.0

Browser

No response

主要言語
TypeScript
スター
3.9k
フォーク
697
平均マージ
3日 12時間
マージ済み PR(30日)
51

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

  • Dockerfile・Docker Compose ファイルなし
  • プルリクエストのテンプレートあり
  • コントリビューションガイドなし

はじめの一歩

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

primer/react のほかの issue

primer/react の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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