Docs: distinguish Fast Refresh effect reruns from Strict Mode checks
まだ誰も着手していません。
評価
- 難易度
- 1/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 88/100
- issue の種類
- ドキュメント
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- react, react-native
調査の方向性
docs/fast-refresh.md の「Fast Refresh and Hooks」セクション付近から始め、リンクされている React Strict Mode リファレンスを読んでください。コード編集後の Fast Refresh と、Strict Mode における開発時のみの Effect の setup および cleanup サイクルを区別する短い説明を追加してください。既存の Fast Refresh の説明を変更せずに、その区別と cleanup に関する指針が明確になっていれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Description
The Fast Refresh page correctly explains that Hooks with dependencies update during a refresh and that even an Effect with an empty dependency list can run again after an edit.
A short clarification could help readers distinguish that behavior from React Strict Mode's separate development-only Effect check.
What is the problem?
When Strict Mode is enabled, developers can observe repeated Effect setup and cleanup without having triggered a Fast Refresh. Because both mechanisms occur during development and both reward resilient Effect cleanup, their output is easy to conflate while debugging.
The triggers and behavior are different:
- Fast Refresh follows a code edit and temporarily ignores dependency lists so the edited Hook logic is applied.
- Strict Mode independently performs an extra development-only Effect setup and cleanup cycle to reveal missing cleanup.
Without that distinction, a developer may incorrectly attribute every repeated Effect to Fast Refresh.
How can we address it?
Add a short note near the end of “Fast Refresh and Hooks,” using the official React Strict Mode documentation as the primary reference.
Possible wording:
Fast Refresh is not the only reason an Effect may run again during development. When Strict Mode is enabled at the application root, React performs an additional development-only setup and cleanup cycle to help find missing cleanup. Fast Refresh reruns Hooks after a code edit, whereas the Strict Mode check can occur on initial mounting without a file save. In both cases, Effects should implement complete cleanup and tolerate being restarted.
Official reference:
https://react.dev/reference/react/StrictMode#fixing-bugs-found-by-re-running-effects-in-development
I can prepare a small docs-only PR against docs/fast-refresh.md if this distinction belongs on the page.
An optional public exercise illustrating the Strict Mode behavior is:
https://frontendatlas.com/react/trivia/react-strictmode-double-invoke-effects
That exercise is not required for the proposed correction; the official React documentation should remain the primary reference.
Why is it important?
It gives React Native developers a more precise debugging model for repeated subscriptions, requests, logs, and cleanup behavior, without weakening the existing guidance that Effects should be resilient.
Who needs this?
React Native developers using function components and Hooks, especially those diagnosing duplicated development-only Effect output.
When should this happen (use version numbers if needed)?
This is not tied to a specific React Native release. It can be made in the docs/fast-refresh.md source for the next documentation version; any current-version backport can remain a maintainer decision.
Disclosure
I maintain FrontendAtlas, an independent frontend interview-prep project, including the optional exercise linked above. No paid, sponsored, or affiliate placement is being requested. I used AI assistance to draft this issue and reviewed it for technical accuracy before posting.
- 主要言語
- MDX
- スター
- 2.2k
- フォーク
- 6.3k
- 平均マージ
- 11時間 37分
- マージ済み PR(30日)
- 19
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
react/react-native-website のほかの issue
-
Integration with Existing Apps: Podfile example does not use `use_react_native!`, is incomplete オープン👋 Good first issue
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
react/react-native-website#2958 · コメント 2 件 ·
-
:ghost: Missing Docs 👋 Good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
react/react-native-website#889 · コメント 5 件 · リアクション 1 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 48/100
react/react-native-website#5216 · コメント 1 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 42/100
react/react-native-website#5154 · コメント 6 件 ·
-
Never gets stale
難易度 2/5 1〜3時間 初心者へのやさしさ 38/100
react/react-native-website#4265 · コメント 2 件 ·
react/react-native-website の issue をすべて見る
似ている issue
-
agent-ready documentation needs-triage
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
-
untriaged
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
dotnet/dotnet-api-docs#13095 ·
-
documentation
難易度 1/5 1時間未満 初心者へのやさしさ 91/100
-
workflow-status page template still says reusable workflows are "triggered only by workflow_call:" オープン
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
-
refactor
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100