reactjs / reactjs/react.dev

[Suggestion]: Add a note about the `use` API as an alternative to `useEffect`

オープン 初心者向け
#8,433 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

type: documentation
主要言語
JavaScript
スター
11.8k
フォーク
7.9k
平均マージ
1日 11時間
マージ済み PR(30日)
11

説明

Summary

The section on the useEffect page about good alternative to fetching data is a great resource, but does not mention the use API at all. I recommend adding some text to clarify the existence of this option and any pros/cons.

Page

https://react.dev/reference/react/useEffect#what-are-good-alternatives-to-data-fetching-in-effects

Details

It is unclear from the documentation what the relationship between useEffect and use is. The useEffect page does not mention the use API at all, and neither does the use page. The useEffect page contains a section called “Fetching data with Effects”, and the use page contains a section called Streaming data from the server to the client. So, it sounds like both can be used for fetching data, but there is no acknowledgement of this or relevant guidance.

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

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

はじめの一歩

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

調査の方向性

まず、useEffect ページの「What are good alternatives to data fetching in Effects?」と、use ページの「Streaming data from the server to the client」セクションを読みます。useEffect と use の関係を、関連するトレードオフも含めて明確にし、それぞれのアプローチがいつ適用されるかを読者が判断できるようにドキュメントを更新します。

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

評価

技術スタック
javascript, react
領域
documentation
issue の種類
ドキュメント
難易度
2/5
見積もり時間
1〜3時間
活発さ
静か
明瞭さ
おおむね明確
初心者へのやさしさ
68/100

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

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