"Lazy initial state" is actually greedy
オープン
まだ誰も着手していません。
- 主要言語
- JavaScript
- スター
- 11.8k
- フォーク
- 7.9k
- 平均マージ
- 1日 11時間
- マージ済み PR(30日)
- 11
説明
Is there any good reason to call the useState(() => ...) feature "Lazy initial state"? The actual implementation is synchronous ("greedy") as far as I can tell, so I would propose to rename it to "Functional initial state" (for consistency with "Functional updates").
- docs: https://reactjs.org/docs/hooks-reference.html#lazy-initial-state
- implementation: https://github.com/facebook/react/blob/02da938fd51f6345ca185d571ea6628189ae81a7/packages/react-reconciler/src/ReactFiberHooks.new.js#L1135-L1142
Related "Lazy initialization" in useReducer section => I would propose "Initialization function"
- docs: https://reactjs.org/docs/hooks-reference.html#lazy-initialization
- implementation: https://github.com/facebook/react/blob/02da938fd51f6345ca185d571ea6628189ae81a7/packages/react-reconciler/src/ReactFiberHooks.new.js#L646-L657
I can make a PR unless someone points out some aspect of the naming that I missed.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
Issue でリンクされている Hooks のリファレンスセクション「lazy initial state」と「lazy initialization」から始めます。それらの用語を、参照されている実装 ReactFiberHooks.new.js および「Functional updates」の文言と比較します。ドキュメントの用語がレビューされ、合意された命名が両方のセクションに一貫して適用されていれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- javascript, react
- 領域
- documentation
- issue の種類
- ドキュメント
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 活発さ
- 停滞
- 明瞭さ
- 明確に書かれている
- 初心者へのやさしさ
- 45/100